ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: satorey on March 04, 2012, 06:11:09 AM
-
I apologize in advance if this is a super noobish question, i have tried looking for ways to do this myself and have just failed. What i want to basically accomplish is a script that will watch a certain chest/container and when items spawn inside of that container it will alert me.Ive been doing alot of reading trying to figure out how to get the script to do this and i tried to have the script click on the chest and then read the journal but that info doesnt seem to get picked up in scanjournal. Im sure there is a 1000 times better way to achieve this i was just hoping someone could push me in the right direction. Thanks in advance.
-
Use event property (http://wiki.easyuo.com/index.php?title=Event_Property) perhaps?
-
well, you could just check for the items you desire, for example gold, as it will respawn each time, so some thing like this?
set %chesttype AAA
set %itemtype BBB_CCC_DDD
repeat
gosub Check_chest
wait 50
until #charghost = yes
stop
Sub Check_chest
finditem %chesttype G_2
if #findcnt > 0
{
set %current_chest #findid
set #lobjectid %current_chest
while #contid <> %current_chest
{
event macro 17
wait 20
}
finditem %itemtype C_ , %current_chest
if #findcnt > 0
{
display the stuff is found
pause
; You could add looting(check exevent drag, exevent drop on wiki) or whatever here.
}
}
return
-
thanks for the help so far. the problems im having with that macro is that the chest im watching in an armoire. so it shows when you open and close it and it only gives you a backpack gump when you open it not when you close it. that is why i was leaning towards using a click/check journal approach which i did end up figuring out. my next problem is im trying to steal the item when it spawns, and i get it to the point where i try and use event macro 22 last target it doesnt target the item and then it doesnt let me use skills after that to saying im busy. here is my junk code for that section, pretty sure im doing alot wrong lol.
sub steal
set #lobjectid JAACOMD ;id of container spawn is in
event macro 17
wait 20
finditem EGG C_JAACOMD ; item ids c_spawning container id
if #findkind -1
{ event macro 17
finditem EGG C_JAACOMD ; item ids c_spawning container id
}
set #ltargetid #findid
event macro 13 33
target
event macro 22 0
wait 10
set #ltargetid MEFQYMD ;recall rune set here
event macro 15 31
target
event macro 22 0
wait 10
event macro 4 4 BANK
finditem EGG C_KNFHLMD ;item ids c_backpackid
gosub moveitem #findid KNFHLMD EPIPUMD ; call sub (itemid) (fromcontainredID) (tocontainerID)
halt
return
Post Merge: March 04, 2012, 05:19:29 PM
problem solved thanks for your help
-
thanks for the help so far. the problems im having with that macro is that the chest im watching in an armoire. so it shows when you open and close it and it only gives you a backpack gump when you open it not when you close it. that is why i was leaning towards using a click/check journal approach which i did end up figuring out. my next problem is im trying to steal the item when it spawns, and i get it to the point where i try and use event macro 22 last target it doesnt target the item and then it doesnt let me use skills after that to saying im busy. here is my junk code for that section, pretty sure im doing alot wrong lol.
sub steal
set #lobjectid JAACOMD ;id of container spawn is in
event macro 17
wait 20
finditem EGG C_JAACOMD ; item ids c_spawning container id
if #findkind -1
{ event macro 17
finditem EGG C_JAACOMD ; item ids c_spawning container id
}
set #ltargetid #findid
event macro 13 33
target
event macro 22 0
wait 10
set #ltargetid MEFQYMD ;recall rune set here
event macro 15 31
target
event macro 22 0
wait 10
event macro 4 4 BANK
finditem EGG C_KNFHLMD ;item ids c_backpackid
gosub moveitem #findid KNFHLMD EPIPUMD ; call sub (itemid) (fromcontainredID) (tocontainerID)
halt
return
Post Merge: March 04, 2012, 05:19:29 PM
problem solved thanks for your help
first off your finditem is wrong.
finditem EGG C_JAACOMD ; item ids c_spawning container id
if #findkind -1
should be
finditem EGG C_ , JAACOMD ; item ids c_spawning container id
if #findkind -1
}
Try this, it should work assumeing you have the proper ids for everything
sub steal
set #lobjectid JAACOMD ;id of container spawn is in
event macro 17
wait 20
finditem EGG C_ , JAACOMD ; item ids c_spawning container id
wait 2 ; a small delay to ensure the finditem reads
if #findcnt > 1 ; i always use findcnt over findkind, i find it more stable
{
set %stolen_item #findid ; set your stolen item id here so it can be used later to unload
set #ltargetid %stolen_item
set #ltargetkind #findkind
event macro 13 33
target
event macro 22 0
wait 10
; recall to bank
set #ltargetid MEFQYMD ;recall rune set here
event macro 15 31
target 2s ; wait for lag, adjsut as needed
event macro 22 0
wait 10
; open bank
event macro 4 4 BANK
; drag stolen item to storage bag in bank
finditem %stolen_item C_ , #backpackid ;item ids c_backpackid
wait 2
gosub moveitem %stolen_item #findstack EPIPUMD ; call sub (itemid) (fromcontainredID) (tocontainerID)
halt
}
return
; %1 = itemid to drag
; %2 = the amount to move
; %3= where to move it to
sub moveitem
exevent drag %1 %2
wait 5
exevent dropc %3
wait 5
return
-
yah thats way better then mine lol. thanks so much for the help.
-
so it worked? I have been out of the scripting for a few years so i am a little rusty. But questions like this help get the old gears turning again.