spiegel06 Posted July 6, 2006 Report Share Posted July 6, 2006 is there a way to make triggers go off at random times? Instead of going off every 5 secs instead like 5 secs then 8,2,12,ect...? Link to comment Share on other sites More sharing options...
zionpsyfer Posted July 6, 2006 Report Share Posted July 6, 2006 in lua, you could write a script that calls the math.random function. Something like math.random(12) Link to comment Share on other sites More sharing options...
spiegel06 Posted July 6, 2006 Author Report Share Posted July 6, 2006 lua? Sorry I do not know what that is. Link to comment Share on other sites More sharing options...
brsingr Posted July 6, 2006 Report Share Posted July 6, 2006 I would like to know same. Link to comment Share on other sites More sharing options...
zionpsyfer Posted July 8, 2006 Report Share Posted July 8, 2006 lua is once of the programming languages in which mushclient allows you to write scripts in. I haven't used it in years, but here's something along the lines of what you're looking for in javascript. function doSend() { world.send("look"); world.AddTimer("relook", 0, 0, Math.floor(Math.random() * + 1, "", 1+2+4+1024+16384, "doSend"); } Where the script says world.send("look"); is the actual sending of "look" to the mud. Here's an intro to scripting in mushclient that'll explain the basics. That code above *should* do what you need once you read the intro. http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6030 If you're going to go further into scripting, you might check out lua before javascript. It's fairly painless compared to Jscript, python or perl. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.