|
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Fri Feb 26, 2021 7:06 pm
Help getting #read stored into a variable |
Hello,
I am using #read 5 to move a direction in a zone after I kill a mob. I am in a zone that has agro mobs and sometimes they attack me when I move, so I want to also load the direction into a variable so if I fail to move that direction I will call the variable after an alarm trigger goes off (for when the mob eventually dies). How do I go about loading #read 5 into a variable? I tried defining the variable and adding #read 5 to it but I get illegal token on the variable. Thanks!
#if (@noMovement=0) {#read 5}
Basically I want to add that to a variable as well for the #read 5.
So if #read 5 sent north to the mud
I want to do something to add north to a variable so I can call it later if I got agreed the second #read entered north. |
|
Last edited by Jaiven on Fri Feb 26, 2021 9:52 pm; edited 3 times in total |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
|
|
|
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Fri Feb 26, 2021 7:51 pm |
I appreciate the advice but that would require me to change huge portions of my entire script. If I ever decide to go about building a new script from the ground up I will certainly look into this method instead of using #read to grab my dirs from a text file. |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Fri Feb 26, 2021 8:29 pm |
Totally understandable, I dreaded my re-writes for a couple of my settings. After the fact was totally worth it but still highly annoying to scrap and restart everything... still have a few more to clean up from old methods that are just absolute trash by comparison.
#READ is honestly beyond my scope, my only other advice is yet more re-write sadly... using %pop and a stringlist in place of your txt file. |
|
|
|
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Fri Feb 26, 2021 11:49 pm |
That was painful but figured it out
#if (@noMovement=0) {
#var direction %read(5,0);#var direction %replace(@direction, ";", "|");
#for @direction {%exec(%i)}} |
|
|
|
|
|