ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: jwardlaw09 on March 12, 2010, 06:18:28 PM
-
hi guys, sorry have to make this quick i am on my way our the door... basic problem i think.
I'm trying to take cervezas healpot tutorial and make it work for me, same concept just bandaids. here is what i have, i think the problem is in the healme sub. let me know what you come up with thanks :D Looking at it again i bet im messing up the finditem command in that sub.... when i run the script nothing really happens :(
set %bandie ( #maxhits - 20 )
SUO
if #hits < %bandie && #sCnt > %bandie_time
{
gosub Healme
set %bandie_time ( #sCnt + 10 )
}
wait 5
until #CharGhost = YES
while #CharGhost = YES
wait 0
GoTo SUO
sub Healme
wait 3
findItem WLOYFRD C_, #backpackID
if #findKind = -1
return
set #lobjectID #findID
set #ltargetKind 1
event macro 17 0
return
-
You need to set the timers at the beginning...
set %bandie_time #sCnt
If you don't do that the script doesn't know if #sCnt is greater then %bandie_time
-
You also need a space in your finditem line:
finditem(SPACE)WHATEVER(SPACE)C_(SPACE),(SPACE)#backpackid
-
awesome thanks guys, i just got home from work so i will make the changes and let you know how it goes. kudos on the tutorial cerveza... easy to understand.
-
Glad you find it useful ;)
-
WOOT! The script was a horrible failure lol... i couldnt figure out why it kept looping when it got to targeting me. I almost posted for help but know i have to do my own research... so i did and it dawned on me i had nothing there for targeting myself after selecting the bandies lol... so fixed it up with a target self event macro and it works great. Only problem is a delay between targeting and applying the first bandie... odd this only affects the first. Anyways i couldnt have made this work without the help of all of you... (the reason i start applying bandies at maxhits - 5 is because of the delay. after the first aid is applied this goes away)
set %bandie_time #sCnt
set %bandie ( #maxhits - 5 )
SUO:
repeat
if #hits < %bandie && #sCnt > %bandie_time
{
gosub Healme
set %bandie_time ( #sCnt + 10 )
}
wait 3
until #CharGhost = YES
while #CharGhost = YES
wait 0
GoTo SUO
sub Healme
wait 3
findItem #charID C_ , #backpackID
if #findKind = -1
return
set #lobjectID #findID
set #ltargetKind 1
event macro 17 0
target 2
event macro 23 0
wait 2
return
-
Changed the hard coded char id to the system's #charID
You could actually be tracked down by your real char ID.
-
sorry to do this to you cerveza but could you elaborate? i know your referring to..
findItem #charID C_ , #backpackID
i realize what charID is but what is the difference between hard coded and system charID?
sorry just sounds important and i wanna make sure i understand.
-
If you use XYZABC in your script, they (developers) could hunt you down because that is a unique ID. If they were to see it here (and I'm sure they wander by) then it might spell trouble.
Use the systems charID with is the same thing, but not specific.
-
WOOT! The script was a horrible failure lol...
You have a timer problem in there too bud. See the %bandie_time #sCnt? How is your if hits < bandie_time statement ever going to be #true if the timer cannot EVER be > than #sCnt? :) Read through it like a book from top to buttom and left to right to see what I"m saying. How is #sCnt going to EVER be greater than %bandie_time unless you specifically set it that way? You need #sCn't to be < OR = to #sCnt. :) When you set a timer, you need to make sure it's initial condition can be matched by your variable so it can get started when the script starts. Also, your timers will count down, so say you do #sCnt + 10, it will start counting DOWN so your varaibles will most of the time read : if suchandsuchtime > #sCnt whatever... :) The timer wont be greater than your variable usually unless that's SPECIFICALLY what you're looking for... hehe It will normally be set to higher than your variable, then the timer will count down and be LESS THAN your variable. Then you can check for < or >. But your initial setting of the timer needs to be something that your equation can start on. Say, set %bandie_time #sCnt, then you would need to do if %bandie_time >= #sCnt... so the initial scan for the timer will be #true enough to start doing the action. :)
set %bandie_time #sCnt
set %bandie ( #maxhits - 5 )
SUO:
repeat
if #hits < %bandie && #sCnt > %bandie_time
{
gosub Healme
set %bandie_time ( #sCnt + 10 )
}
wait 3
until #CharGhost = YES
while #CharGhost = YES
wait 0
GoTo SUO
sub Healme
wait 3
findItem #charID C_ , #backpackID
if #findKind = -1
return
set #lobjectID #findID
set #ltargetKind 1
event macro 17 0
target 2
event macro 23 0
wait 2
return
[/quote]