9/3/2023 0 Comments Mudlet achaea snap![]() While and for loops are a bad thing in JavaScript, why you ask because JavaScript is single threaded and they are blocking functions, which means while either are in effect nothing else is processing. instead of using the call function option just execute a script and call the function either as a JavaScript function or call it like I do with the run_function call that I showed in the last postĢ. ![]() I also noted that the "call function" action does not allow any arguments.ġ. ![]() I select the "call function" sub action and get no errors, but no results either. This is where I have drawn a total blank. Having done this and considered that there are many other users for random numbers, either for debating, RP or possibly to add a wild factor into hunting/combat, I decided that my implementation was not very elegant, and that it would be much better to have a "getRandomNumber(min,max)" function defined that I could call from multiple packages where I wanted to use it.Īs an initial step I tried porting the trivial random number JS from the "execute script" action of CMD1 in the influence package to a Function in the influence package and replacing "execute script" with "call function". This command pair works well and does exactly what I want. Set a mindset according to the random value determined by JS In the influence package I created a background reflex to run continuously on a timer randomly rotating mindsets.Įxecute script: JS using Math.random and some manipulation to give a random number within the specified min/max I have the main package of reflexes with generic utility reflexes and then separate packages of reflexes for influence, hunting, there will eventually be one for pvp also. Here are the exact details of what I did - and what I would like to achieve:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |