ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Ketchup on November 07, 2015, 08:43:01 AM
-
I have these two subs but I'm not sure how to go about closing and hiding the corpse after I've finished looting, if anyone could add it in and show me how it's done I would be grateful!
Thanks!
;--------------------------------------------------------------
;--------------------------------------------------------------
sub loot
finditem YFM G_2
if #findkind <> -1
{
set %mobs_killed %mobs_killed + 1
set %corpse #findid
if %skin = #true && %training_mode = #false
{
if %use_war_cleaver = #true
set %skin_tool %cleaverid
set #lobjectid %skin_tool
event macro 17 0
target
set #ltargetid %corpse
event macro 22 0
wait 17
}
if %loot_gold = #false && %loot = N/A
{
ignoreitem %corpse
return
}
set #lobjectid %corpse
event macro 17 0
wait 5
gosub wait_gump container_gump 144_212 3
if #result = #false
return
wait 5
set %loot_container #contid
wait 13
ignoreitem %corpse
}
if #findkind = -1
return
gosub grab_items
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub grab_items
if %loot_gold = #true
{
wait 4
finditem POF C_ , %loot_container
if #findkind <> -1
{
exevent drag #findid #findstack
wait 13
exevent dropc #backpackid
wait 13
}
}
finditem * C_ , %loot_container
for %i 1 #findcnt
{
finditem %loot C_ , %loot_container
if #findkind <> -1
{
exevent drag #findid #findstack
wait 13
exevent dropc #backpackid
wait 13
}
finditem %stackables C_ , %loot_container
if #findkind <> -1
{
exevent drag #findid #findstack
wait 13
exevent dropc #backpackid
wait 13
}
}
if %skin = #true && %use_war_cleaver <> #true
{
lloop:
gosub weight_check
wait 2
while #true
{
finditem EEG C_ , %loot_container
if #findkind <> -1
{
set #lid #findcnt
if #weight > %weight_before_split
{
set %damount #findstack / 2
if #findstack <= 15
set %damount #findstack
}
else
set %damount #findstack
exevent drag #findid %damount
wait 14
exevent dropc #backpackid
wait 15
}
if #findkind = -1
break
wait 5
finditem kag C_ , #backpackid
set #lobjectid #findid
event macro 17 0
target 2s
finditem eeg C_ , #backpackid
set #ltargetid #findid
event macro 22 0
wait 5
wait 10
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
-
Here one of my first draft looter . Maybe that will give you idea
set %open 20
set %loot 15
set %corpseID YFM
set %itemtype xxx_yyy
loop:
finditem %corpseID G_2
if #findkind = 1
goto lootcoarpse
if #findkind = -1
goto loop
lootcoarpse:
set #lobjectid #findid
event macro 17 0
ignoreitem #findid
set #nextCPosX 600
set #nextCPosY 305
wait %open
goto loot
loot:
IF #CONTTYPE = YFM
set %corpse #contid
FINDITEM %itemtype C_ , %corpse
If #findkind = -1
{
wait %loot
goto loop
}
wait %loot
{
exevent drag #findid #findstack
exevent dropc #backpackid
wait 20
goto loot
}
-
I've messed around with it a bit but currently everything I have tried doesn't work
-
Closing a gump: http://wiki.easyuo.com/index.php?title=Click
set %gumpX #contposx + 5
set %gumpY #contposy + 5
click %gumpX %gumpY r ; Right clicks on the gump
Hiding a corpse: http://wiki.easyuo.com/index.php?title=HideItem
set %corpse YFM_FEX_QEX
findItem %corpse G_12
hideItem #findId
ignoreItem #findid 1 ; ignoreItem http://wiki.easyuo.com/index.php?title=IgnoreItem
then later
ignoreitem reset 1
-
could you add that into my first post in the script and submit it here please?
-
could you add that into my first post in the script and submit it here please?
That one i will leave up to you. That is how you learn.
-
could you add that into my first post in the script and submit it here please?
That one i will leave up to you. That is how you learn.
Tidus, you give a man a script he is demanding again in an hour. If you teach him to build a script you do him a good turn.
-
after so much testing and messing around with this I finally got it working today and I feel so good about something so easy, thanks for your help guys.
-
after so much testing and messing around with this I finally got it working today and I feel so good about something so easy, thanks for your help guys.
See, we knew you could do it!
-
Glad you figure it our.
Now that you earn how, are you going to post your result.
-
Yeah, I'm all up for sharing, not sure if this was the best way to do it but I tested a few and this worked so I'll stick with it. From modifying this I actually learn a lot and it helped me add everything I wanted to my script, thanks so much guys! My advice to anyone is try to do it yourself, it's much more rewarding!
;--------------------------------------------------------------
;--------------------------------------------------------------
sub loot
finditem YFM G_2
if #findkind <> -1
{
set %mobs_killed %mobs_killed + 1
set %corpse #findid
if %skin = #true && %training_mode = #false
{
if %use_war_cleaver = #true
set %skin_tool %cleaverid
set #lobjectid %skin_tool
event macro 17 0
target
set #ltargetid %corpse
event macro 22 0
wait 17
}
if %loot_gold = #false && %loot = N/A
{
ignoreitem %corpse
return
}
set #lobjectid %corpse
event macro 17 0
wait 5
gosub wait_gump container_gump 144_212 3
if #result = #false
return
wait 5
set %loot_container #contid
wait 13
ignoreitem %corpse
}
if #findkind = -1
return
gosub grab_items
hideitem %corpse
return