ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: NecroFox on August 22, 2011, 01:13:54 PM

Title: is there a way
Post by: NecroFox on August 22, 2011, 01:13:54 PM
Is there a way to make a script choise random numbers? if so whats the command for them?
Title: Re: is there a way
Post by: Cerveza on August 22, 2011, 01:28:10 PM
You know where the documentation is at EasyUO?

#random (http://wiki.easyuo.com/index.php?title=Random)
Title: Re: is there a way
Post by: Endless Night on August 22, 2011, 01:29:04 PM
http://wiki.easyuo.com/index.php?title=Random
Title: Re: is there a way
Post by: Cerveza on August 22, 2011, 01:31:02 PM
set #cervPostTimer ( #enPostTimer - 56 )

 :P
Title: Re: is there a way
Post by: NecroFox on August 22, 2011, 01:34:24 PM
Ty i didn't know what the code name was
Title: Re: is there a way
Post by: NecroFox on August 22, 2011, 01:37:08 PM
so from the wiki

Code: [Select]
;make a random number between 0 and 99.
set %a #random % 100

;make a random number between a range of two numbers
;set %random1 #random % %increments + #bottom
;%increments is (top# - bottom#) + 1
;#top is the highest number of the range
;#bottom is the lowest number of the range
;example of two random numbers between 3 and 10
set %random1 #random % 8 + 3

Does this mean i can do

set %random_num #random %2

means i can set a random number to choise from 1 to 2?
Title: Re: is there a way
Post by: Endless Night on August 22, 2011, 01:43:20 PM
spaces remember spaces... EUO is very unforgiving wihtout spaces

so NOT
set %random_num #random %2

this
set %random_num #random % 2


That gives a random number between 0 and 1
if you want 1 - 2  you must +1
ie

set %random_num #random % 2  + 1

Title: Re: is there a way
Post by: NecroFox on August 22, 2011, 02:16:18 PM
ah ok i see tyvm


as for coding

Code: [Select]
finditem %bait C_ , #backpackid
set #lobjectid #findid
event macro 17 0
wait 10
finditem %pole C_ , #backpackid
set #ltargetid #findid
event macro 22 0
halt

it wont target the pole but i set it as the last target then the code clicks the last target why wont it set the bait?
or is that coded wrong?
Title: Re: is there a way
Post by: Endless Night on August 22, 2011, 02:47:35 PM
solved .. set #targetkind 1