EasyUO.com
http://www.easyuo.com/forum/

Using a Standard Variable or Persistent Variable to equip
http://www.easyuo.com/forum/viewtopic.php?f=2&t=53628
Page 1 of 1

Author:  Anafalas [ Sat Jun 09, 2018 3:54 pm ]
Post subject:  Using a Standard Variable or Persistent Variable to equip

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.  

Author:  Orngrimm [ Sun Jun 10, 2018 11:06 am ]
Post subject:  Re: Using a Standard Variable or Persistent Variable to equi

- 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

Author:  Anafalas [ Sun Jun 10, 2018 4:54 pm ]
Post subject:  Re: Using a Standard Variable or Persistent Variable to equi

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.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/