Official ScriptUO EasyUO Scripts > Script Debug

Saving settings?

<< < (2/3) > >>

Katu:

--- Quote from: 12TimesOver on April 05, 2010, 02:41:47 AM ---There is no way to delete the reg entries with EUO after creating them so try to keep the Persistents only to the necessary ones!
--- End quote ---

There is a way to delete those. Download EasyUO 1.4 and from options->variables->Delete all persistent variables.

-Katu

12TimesOver:

--- Quote from: Katu on April 05, 2010, 09:07:50 AM ---
--- Quote from: 12TimesOver on April 05, 2010, 02:41:47 AM ---There is no way to delete the reg entries with EUO after creating them so try to keep the Persistents only to the necessary ones!
--- End quote ---

There is a way to delete those. Download EasyUO 1.4 and from options->variables->Delete all persistent variables.

-Katu

--- End quote ---
Thanks for pointing that out Katu! Not exactly what I meant though so let me rephrase, there is no way to delete your own entries using EUO code. You can certainly go in and manually purge individual entries as well. My point was that I can use EUO to create reg entries but a script can't clean up after itself thus the registry can get messy.

X

baldielocks:
Wanted to show I actually TRY to do research before I ask newblet questions.

What about over-writing an existing *var ? I'm THINK there is a way, but stumbling on the method. (this is from C_2's LAME)

--- Code: ---gosub setpixel-primary
sub setpixel-primary
    event macro 35 0
    display Move the mouse to the BOTTOM LEFT CORNER of the Primary Weapon Move button. You have 2 seconds
    wait 2s
[b]    savePix #CURSORX #CURSORY 2[/b]
    wait 5
return
--- End code ---

If I wanted to save the CMPPIX as a persistent for a specific character, I would do

--- Code: ---savePix #charid , savePix #CURSORX #CURSORY 2
--- End code ---

Now that I have it saved, i can skip set up for that everytime, which is nice!
But if Location of the tile changes, how would I go about skipping setup until I need to re-do it? I have tried several variations of a true / false state on the var.

TrailMyx:
SavePix doesn't save a value from run to run of EasyUO, but only that instance.  If you want your script to remember a value  between times when you run a script, you must poke it back into a file somewhere or create a persistent variable for it ( * variable).

To quickly make a way to save/recall items from the registry (where persistent variables are stashed), I made these 2 little subs:


--- Code: easyuo ---;------------------------------------------------------------sub TM_GetPersistantVariable  set #RESULT %1 , _ , #CHARID  set #RESULT * . #RESULTreturn #RESULT;------------------------------------------------------------sub TM_SetPersistantVariable  set #RESULT %1 , _ , #CHARID  set * . #RESULT %2return 
These subs use your own #CHARID as a reference pointer to help you locate the value after its been stored. 

A script like my bandage script, I first save the values like this:

--- Code: easyuo ---    gosub TM_SetPersistantVariable TM_HEAL_BANDAGE !heal_bandage    gosub TM_SetPersistantVariable TM_HEAL_CHIVALRY !heal_chivalry    gosub TM_SetPersistantVariable TM_HEAL_MAGERY !heal_magery    gosub TM_SetPersistantVariable TM_HEAL_NECROMANCY !heal_necromancy... 
When I first start the script, I call the Get for each of these variables and assigned them as needed (display, variables, etc):


--- Code: easyuo ---  gosub TM_GetPersistantVariable TM_HEAL_BANDAGE  menu set EUOCheckBox1 #RESULT  gosub TM_GetPersistantVariable TM_HEAL_CHIVALRY  menu set EUOCheckBox3 #RESULT  gosub TM_GetPersistantVariable TM_HEAL_MAGERY  menu set EUOCheckBox2 #RESULT  gosub TM_GetPersistantVariable TM_HEAL_NECROMANCY  menu set EUOCheckBox4 #RESULT... 
Note you don't address the actually *var directly but you rely on the Get and Set subs for that so they can create the variable string for you.

EX.  #CHARID = XXYYZZ1, Variable=MooseCount

Inside TM_SetPersistantVariable

--- Code: easyuo ---  set #RESULT %1 , _ , #CHARID ; #RESULT becomes "MooseCount_XXYYZZ1",  this is the variable name used for this value in the registry  set * . #RESULT %2 ; used indirect reference "." to address *MooseCount_XXYYZZ1 and assignes whatever is in %2return 

baldielocks:
Thanks TM. What about overwriting the variable if I need to change it?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version