ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Pop Rock on April 09, 2011, 06:59:03 AM
-
Ok I'm trying to make a BoS sub to to look for the BoS, a certain item, if there is that certain item there, use the BoS on it and then return to the script, so far i have this...
set %bosid CKF
gosub sendkits
sub sendkits
finditem HAG C_ , #backpackid
if #findkind = -1
{
return
}
else
{
finditem %bosid C_ , #backpackid
set #lobjectid %bosid
set #ltargetid HAG
event macro 17 0
wait 5s
event macro 22 0
return
}
Am i doing this right?? I looked at TM's sub but that won't work for me becasue I dont need a certain weight to send it... So I decided to make my own and i'm having trouble.. can anyone help me??
-
LINK (http://www.scriptuo.com/index.php?topic=1356.0;highlight=bos+sub)
-
First off, nice job working this out on your own so far!
I would suggest that you make the BOS sub a little more generic so that you can pass it the ID of the item you would like to target, so for example "Gosub BOS %Goldtypes" or "Gosub BOS %KitTypes", etc. That way you can use the same sub in any script you want to put it into :)
That's not what you asked though so as for your question, you'll need to add "set #ltargetkind 1" in there for starters. Also, HAG is the ItemType, not ItemID. You should set the LtargetID to your #findID.
Just a couple other "constructive" thoughts, 5 seconds is a pretty long timer for that action unless you are playing with extreme lag. You can certainly keep it that long but definitely not necessary. Also, an If statement that has only one line in the action doesn't require {} - again, you can definitely keep them there, some people like doing that just as a standard, but you don't have to. If there's more than one line you need the {}.
Keep working it!
X
-
Ok, I've talked with one of my scripter friends and this is what I've come up with:
set %bosid CKF
set %lootbag MUNJOMD
gosub sendkits
sub sendkits
finditem HAG C_ , %lootbag
set %tool #findid
if #findcnt = 0
return
finditem %bosid C_ , #backpackid
if #findcnt = 0
{
Event sysmessage NO BOS!!
return
}
set #lobjectid %bosid
set #ltargetid %tool
set #ltargetkind 1
event macro 17 0
target event macro 22 0
return
}
But what is happening now is nothing it's like the script can't find anything... and he can't figure it out either :/ Can anyone help?
-
What is the value of %bosid?