Total players online: 6



Take the Tour | Site Map

It is currently Sat Oct 20, 2018 9:41 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Jun 09, 2018 3:54 pm 
Offline
Apprentice Scripter
Apprentice Scripter

Joined: 04/20/2018 11:16
Posts: 16
I am wondering if I should use a Standard Variable or a Persistent Variable to equip an axe for the lumber jacking script I am makeing. My ultimate goal is to just run it without having to assign any variables to it, which would mean I want persistent, but during my testing while creating the script I can't get the axe to equip.

If I leave it Standard it works (here is all pertaining to the axe so far in the script)

Code:
  1.  
  2.    gosub Setup
  3. ;***** MAIN *****
  4.   Main:
  5.   gosub GetAXE
  6.   goto Main
  7. ;***** END MAIN*****
  8.  
  9.   Sub Setup
  10.  
  11.         display ok Click Ok then select your AXE
  12.         set #targcurs 1
  13.         target
  14.       s3_targetloop:
  15.       if #targcurs = 1
  16.          goto s3_targetloop
  17.         set %AXE #ltargetid  ;Should I leave this as a Standard Variable or make Persistent
  18.       return
  19.  
  20.  
  21. ;*********Arming Axe*********
  22.    Sub GetAxe ;this should arm your axe for you
  23.  
  24.    EXEVENT equip %AXE  ;As a Standard Variable it equips the axe.
  25.    return              ;But as a persistent, I can't get it to equip
  26. ;*********Arming Axe********
  27.  


Looking for idea this is the closest that I could find.
Code:
  1. ;*********Arming Axe*********
  2.    Sub GetAxe  ;this should arm your axe for you
  3.  
  4.    set %axe *Axe . #charid
  5.    set #lobjectid %axe
  6.    Finditem %axe
  7.    EXEVENT equip %axe   ; I cannot get it to equip the Axe.
  8.    return
  9. ;*********Arming Axe*********
  10.  


Top
  Profile 
PostPosted: Sun Jun 10, 2018 11:06 am 
Offline
Administrator
Administrator
User avatar

Joined: 08/12/2003 07:28
Posts: 18926
Location: Switzerland

- if you only change ONE %axe to *axe and leave the other %axe as %axe, it of course wont work because you never sat %axe and %axe would be N/A
- If you change every %axe to *axe it should work
- Your second idea should work as well, IF you also save the ID as *Axe . #CharID

_________________
EUO Member and postwhore since: 19th Dezember, 2002; Loosing on freeshard Alexandria since: 5th January, 2005
Searches cure for cancer since: 17th November, 2003 on GRID.org & Worldcommunitygrid.org
Made scripts for Project 'Programmers for Alexandria' worth 50$
Image
Quote "mmorning": Where would theses boards be if Orn didn't miss all the sarcasm. Man its great having him here :)
Quote "author-unknown": Good idea. I gotta start doing that too. You're a trendsetter Orn. :)
Quote "dreyfus": #true is always #true


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Sun Jun 10, 2018 4:54 pm 
Offline
Apprentice Scripter
Apprentice Scripter

Joined: 04/20/2018 11:16
Posts: 16
Thank you, that worked like a charm, now has soon as I get it to chop a tree then it will be all complete and ready for testing.


Top
  Profile 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Hosted by CalWeb Internet Services, Inc.