ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: coachcraig on November 29, 2011, 05:23:09 PM
-
So this is my very first atempt at writing a script. I read the tutorials and tried to write a simple "First" script. LOL...well... the script is supposed to check to see if there are shoes in the backpack. If so, it's supposed to drag them and drop them on your pet goat. I've got the script to do everything but drop them on the goat. Just wanted to know if anyone could look at this and let me know what i'm doing wrong.
;=================================================================
; Script Name: The Shoe Eating Goat
; Author: Coachcraig
; Version: 1.0
; Shard Origin
; Revision Date: 11/29/2011
; Purpose: to get rid of those annoying shoes, boots, sandels and thigh boots
; Globals: None
;=================================================================
set %goat ZF
set %shoe PVI_AWI_ZVI_CWI_NVI_QVI_TVI_OVI
;==================Mainloop=============================
SUO:
repeat
gosub get_shoe_and_feed_goat
until #CharGhost = YES
while #CharGhost = YES
wait 0
GoTo SUO
;==================Subloop=============================
sub get_shoe_and_feed_goat
findItem PVI_AWI_ZVI_CWI_NVI_QVI_TVI_OVI C_ , #backpackID
if #findKind = -1
return
event Drag #findID
wait 3
set #ltargetid %goat
exevent dropc %goat
Msg There ya go boy. Eat up.$
wait 5
return
-
First thing is you can't really mix event drag and exevent drop. You should use exevent drag
-
Ah I see. changed that but it still trys and drags the item over but it doesn't recognize the goat. Any idea as to why it's not seeing the goat?
and thank you for the response.
-
Ok, next is you can't just used the #FINDTYPE of the goat. You need the actual #FINDID of the goat. You can either hardwire it in your code, or "target" your goat, then retrieve the #LTARGETID as that will be the #FINDID of your goat.
Best of all is do a quick search around you to find any critter with the #FINDTYPE of ZF. That should be your goat, and you can use that #FINDID.
-
that worked. You have no idea how much that means. ;D
my first script with your help!!!
thank you TrailMyx very much
-
that worked. You have no idea how much that means. ;D
my first script with your help!!!
thank you TrailMyx very much
I'm glad you figured it out! Congrats on your first script. I guarantee the next one will be easier now that you have the first one under your belt. ;)
-
Another suggestion:
findItem PVI_AWI_ZVI_CWI_NVI_QVI_TVI_OVI C_ , #backpackID
+
Why define variable when u dont use?ReplacePVI_AWI_ZVI_CWI_NVI_QVI_TVI_OVI
it with %Shoe
-
i did last night. i got to looking at it a little more closely and this is the new script and even took out an extra line of code. and thank you for your input. ;)
i'm so excited to get my first done. now i'm on to tackling other tasks and once i learn basics and get used to scripting i hope to contribute to the community.
;=================================================================
; Script Name: The Shoe Eating Goat
; Author: Coachcraig
; Version: 1.0
; Shard OSI / FS: OSI / FS OK
; Revision Date: 11/29/2011
; Purpose: to get rid of those annoying shoes, boots, sandels and thigh boots
; Globals: None
;=================================================================
;add you goat's #findID here
set %goat DBVFUB
;shoe types are set here
set %shoe PVI_AWI_ZVI_CWI_NVI_QVI_TVI_OVI
;==================Mainloop=============================
SUO:
Msg All Follow Me$
repeat
gosub get_shoe_and_feed_goat
until #CharGhost = YES
while #CharGhost = YES
wait 0
GoTo SUO
;==================Subloop=============================
sub get_shoe_and_feed_goat
findItem %shoe C_ , #backpackID
if #findKind = -1
return
exevent Drag #findID
wait 10
exevent dropc %goat
Msg There ya go boy. Eat up.$
wait 15
return
-
congrads, but next time please put your code in to the code tags
-
congrads, but next time please put your code in to the code tags
Alternate : Attach the scriptfile:) that saves Space to talk;)