ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: UOMaddog on August 21, 2011, 04:31:12 PM
-
So, I had an idea for a script that would search for players around your character, and if they're orange faction players, it would add a button to a menu with the player's name. When you clicked their name, it would set them as last target. Now, if an opposing faction player runs on your screen, then runs back off, I don't want it to disappear! So my idea was, as soon as you see a new player, add them to a list and set a timer for that person (say 60 seconds) and if they don't reappear on your screen within that time, then it disappears. If they do reappear, then you reset their timer. Now of course, I'm doing this with OLD EUO not the probably nicer and more elegant OEUO! Is it best to start 2 lists with _ separators and just scan through the list counting the number of _'s until i hit their ID, then counting the same through the other 2 lists (for remaining time and char name) OR should I create a dynamic variable on the fly that incorporates their ID and do it that way somehow? Looking for any creative listing ideas. In java I'd just use an ArrayList and be happy, but oh well!
-
Now that sounds like it will be useful and hard to code.
-
My list handling subs are exactly what you are looking for. They handle a visible element, plus a non-visible element. They also control the visible list so you can organize the entries and even alphabetize if you want.
You should give'em a whirl....
http://www.scriptuo.com/index.php?topic=21.0
-
you can also check out my flatfile emulator
http://www.scriptuo.com/index.php?topic=7618.0
-
what is a file emulator?
-
@TM: Thanks! I came across the list/tab handling ones but couldn't find the one you linked.
Is there anyway to have 2 tags? I don't want to have to do 2 lists with the same item and different tags (or is that the best way to do it)
Ideally:
#FINDID - DISPLAYNAME - TIMER
-
what is a file emulator?
umm a flatfile is a type of database. http://en.wikipedia.org/wiki/Flat_file_database Emulator means it trys to act like to the best of its ability which in EUO is not all that easy.
-
@TM: Thanks! I came across the list/tab handling ones but couldn't find the one you linked.
Is there anyway to have 2 tags? I don't want to have to do 2 lists with the same item and different tags (or is that the best way to do it)
Ideally:
#FINDID - DISPLAYNAME - TIMER
You could easily use the 2nd tag to store all that information. I use my sub-string subs to "index" items separated by a delimiter. In the example I use a "#"
http://www.scriptuo.com/index.php?topic=1101.0
-
Only problem with my tables over TMs listhandler is that i never completed a find routine. (but would be easy enough to do one)
; Initialize Pathing and Create the table
set #lpc 9000
set %EN_Table C:\easyuo/EUO , #spc , Scripts\ENs-Scripts\ENs-Subs-Tables.Txt
call %EN_Table EN_Table_Create People ID NAME TIMER ; Create table
; Add a record
set !time #Scnt + 60
Call %EN_Table EN_Table_Append #findid #property !time
-
@TM: Thanks! I came across the list/tab handling ones but couldn't find the one you linked.
Is there anyway to have 2 tags? I don't want to have to do 2 lists with the same item and different tags (or is that the best way to do it)
Ideally:
#FINDID - DISPLAYNAME - TIMER
You could easily use the 2nd tag to store all that information. I use my sub-string subs to "index" items separated by a delimiter. In the example I use a "#"
http://www.scriptuo.com/index.php?topic=1101.0
Perfect Idea TM!!
ITEM = #FINDID
TAG = DISPLAYNAME_TIMER
Quick question to make this even easier, are all charid's a certain length???
-
Quick question to make this even easier, are all charid's a certain length???
Not necessarily. On OSI I think they are the same, but on RunUO they are shorter. I wouldn't rely on the length, and just parse using a delimiter.