Author Topic: simple for you, but hard for this newbe  (Read 3928 times)

0 Members and 1 Guest are viewing this topic.

Offline coachcraigTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Activity:
    0%
  • Reputation Power: 1
  • coachcraig has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
simple for you, but hard for this newbe
« on: November 29, 2011, 05:23:09 PM »
0
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

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.8%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: simple for you, but hard for this newbe
« Reply #1 on: November 29, 2011, 05:27:41 PM »
0
First thing is you can't really mix event drag and exevent drop.  You should use exevent drag
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline coachcraigTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Activity:
    0%
  • Reputation Power: 1
  • coachcraig has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: simple for you, but hard for this newbe
« Reply #2 on: November 29, 2011, 05:32:03 PM »
0
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.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.8%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: simple for you, but hard for this newbe
« Reply #3 on: November 29, 2011, 05:36:03 PM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline coachcraigTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Activity:
    0%
  • Reputation Power: 1
  • coachcraig has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: simple for you, but hard for this newbe
« Reply #4 on: November 29, 2011, 05:47:19 PM »
0
that worked. You have no idea how much that means.  ;D
my first script with your help!!!

thank you TrailMyx very much

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.8%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: simple for you, but hard for this newbe
« Reply #5 on: November 29, 2011, 06:02:45 PM »
0
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.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: simple for you, but hard for this newbe
« Reply #6 on: November 29, 2011, 10:25:51 PM »
0
Another  suggestion:
Code: [Select]
findItem PVI_AWI_ZVI_CWI_NVI_QVI_TVI_OVI C_ , #backpackID+
Why define variable when u dont use?Replace
Code: [Select]
PVI_AWI_ZVI_CWI_NVI_QVI_TVI_OVI it with %Shoe

Offline coachcraigTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Activity:
    0%
  • Reputation Power: 1
  • coachcraig has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: simple for you, but hard for this newbe
« Reply #7 on: November 30, 2011, 04:23:43 AM »
0
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

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: simple for you, but hard for this newbe
« Reply #8 on: November 30, 2011, 04:53:31 AM »
0
congrads, but next time please put your code in to the code tags
What you witness -- is whatver..
uogamers hybrid.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: simple for you, but hard for this newbe
« Reply #9 on: November 30, 2011, 06:56:06 AM »
0
congrads, but next time please put your code in to the code tags
Alternate : Attach the scriptfile:) that saves Space to talk;)

Tags: