Jump to content

Random Numbers With Hscript/windows


lisux

Recommended Posts

Hi everybody.

I am making an hscript tar is embeebed ito an OTL, is a section of the otl and is called by a button as a callback script.

I have to use H8 on Windows (unfortunaltely :( )

And well my problem is the nex I ned to get a random number per every execution of the script, because the time and date commans in windows are unusable for this task I have decided to use the time hscript command calculating the time of recursively list all the nodes in the scene,if you use the next in the textpor it should work correctly:

set randN = `rand(strreplace(run("time(\"opls -R / \")"), "r", ""))`

Basically it calculates the time of the opls command, rid of the r in the time result and make a rand over it.

My problem is that this chunk of code works perfectly in the textport but when I try to inclue it in a callback script for a button in an otl it fails.

I know it is failling because I put a message comand after the code and it doesn't appear, a little hack to debug hscripts in otls.

Can Somebody give me any clue about this?

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...