ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Guadah on September 13, 2011, 04:56:19 AM
-
So I have a script that saves the id's of bags selected and opens them upon start up, so you don't have to select the bags each time you start to run the script. However, if you are not near the bag, it errors... So I'm trying to figure out a way to write
find %resource_bag C_
if %resource_bag (not found)
gosub set_resource_bag
My problem is I'm not sure what to code for the (not found) part. Suggestions?
(I'm going to blame this on lack of sleep...)
-
you mean something like this? Or did I get you wrong?
finditem %resource_bag C_
if #findcnt = 0
{
set #lobjectid %secure
while #contid <> %secure
{
event macro 17
wait 10
}
finditem %bag C_ , %secure
if #findcnt > 0
set %resource_bag #findid
else
{
display no bags found
stop
}
}
-
you mean something like this? Or did I get you wrong?
finditem %resource_bag C_
if #findcnt = 0
{
set #lobjectid %secure
while #contid <> %secure
{
event macro 17
wait 10
}
finditem %bag C_ , %secure
if #findcnt > 0
set %resource_bag #findid
else
{
display no bags found
stop
}
}
where u got %Secure?
Finditem %Ressourcebag C
if #findkind <> -1
{
set %Yourbag #findid
return #true
}
Else
{
display yesno No Bag Found, want to target manualy?
if #dispres = yes
{
set #targcurs 1
while #targcurs=1
{
wait 1
}
set %Yourbag #ltargetID
return #true
}
else
{
return #false
}
}
Maybe something liemk this?
-
well if no %resource_bag found, he takes it from secure.. Well it was just a thought.
-
I scratched the entire idea. It was overly complicated and not necessary afterall. The main issue was if the Secure was not open, they could not open their resources bag... since I never call for them to target the 'secure' or 'bank'. It was just an attempt at a safety measure, but I'm not going to release this script to the public. It's just my version of a Slayer book maker.
-
put this before the code and you will be fine.
set #lobjectid %secure
while #contid <> %secure
{
event macro 17
wait 10
}
-
put this before the code and you will be fine.
set #lobjectid %secure
while #contid <> %secure
{
event macro 17
wait 10
}
while #contid <> %secure
{
set #lobjectid %secure
event macro 17
wait 10
}
Dunno i would do like this because if you overlay other targeting it could be complicated...
-
If I go the route for working this script out of the house, I'll re-write it in. As it stands, it works at a bank. Crafts a bag full of runebooks, checks them for Super-Slayers, bags them, Recalls to the Library... then won't open up the Gump from the NPC. Then it'll recall back to the bank and repeat.
Everything except for the NPC works so far. But I'll get it.
sub library
gosub TM_TravelFromRunebook RE 11 12 %runebookid
finditem %npc
set %lobjectid #findid
event macro 17 0
wait 10
set %x #contposx + 40
set %y #contposy + 165
click %x %y ; Donate a Bag
set #ltargetid %dump_bag
while #targcurs <> 1
event macro 22 0
wait 10
set %x #contposx + 355
set %y #contposy + 340
click %x %y ; Donate ALL
wait 10
gosub TM_TravelFromRunebook RE 4 5 %runebookid
gosub reopen_bags
return
-
If I go the route for working this script out of the house, I'll re-write it in. As it stands, it works at a bank. Crafts a bag full of runebooks, checks them for Super-Slayers, bags them, Recalls to the Library... then won't open up the Gump from the NPC. Then it'll recall back to the bank and repeat.
Everything except for the NPC works so far. But I'll get it.
sub library
gosub TM_TravelFromRunebook RE 11 12 %runebookid
finditem %npc
set %lobjectid #findid
event macro 17 0
wait 10
set %x #contposx + 40
set %y #contposy + 165
click %x %y ; Donate a Bag
set #ltargetid %dump_bag
while #targcurs <> 1
event macro 22 0
wait 10
set %x #contposx + 355
set %y #contposy + 340
click %x %y ; Donate ALL
wait 10
gosub TM_TravelFromRunebook RE 4 5 %runebookid
gosub reopen_bags
return
line 4: set %lobjectid #findid
should be set #lobjectid #findid
I guess that should make it work heh
-
haha, yeah that'll do it. Making some modifications etc and then I'll get back to testing it out. If I get it working smoothly I'll post it here if anybody wants it.
-
Just trying to work out how to read if the spellbook has 3 Mod Properties... then I'll post it.
-
set #lobjectid #findid
event macro 17 0
wait 10
[code]
you may want to wait for the gump instead of just inserting a regular wait
[code]
set %gump_timer ( #sCnt + 5 )
while #gumpsize <> 23000_204499 || #sCnt < %gump_timer
wait
dont forget to change the gump size.[/code][/code]
-
I did. Check out the script, give it a test run, let me know what you think.
http://www.scriptuo.com/index.php?topic=8503.msg73337#new