Author Topic: TrailMyx's List Handling Subs  (Read 86919 times)

0 Members and 1 Guest are viewing this topic.

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #75 on: March 10, 2010, 07:13:56 AM »
0
That's an implementation thing really.  I just care about a filename and a listname for save and only filename for load.  After that, it's independent of your implementation.  That's the nice thing about tools, I just write'em.  but the mantra of tools is just to keep them generic.

I don't really know how it could have worked with 4 lists and one file.  I've been drinking a bit at the moment, so my analytical skills are a bit impaired.    I think you just got lucky.  :p

TM WAKE UP. :)  It's saving as a name, and #SHARD, and #CHARNAME and then .txt.  So it's unique per char per shard. :)  The problem is it's not saving the same for all chars.  It's cutting off the .txt extension for some.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's List Handling Subs
« Reply #76 on: March 10, 2010, 10:18:16 AM »
0
Lol, I didn't possess you and force you to save that way.  Look at the sample code, I use:

gosub TM_LoadListFromFile c:\testlist.txt ; load a list from file

So it's up to you to use them.  Do a scan of the list functions.  You won't find a single reference to #SHARD or #CHARNAME.  If you're code is doing that, then it's been possessed!

Like I said, I write the tools, you hack them... :p
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: TrailMyx's List Handling Subs
« Reply #77 on: March 10, 2010, 10:24:32 AM »
0
Like I said, I write the tools, you hack them... :p
Hehe...

And you're a little bit country, I'm a little bit rock-and-roll!

:D
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #78 on: March 10, 2010, 10:25:36 AM »
0
Lol, I didn't possess you and force you to save that way.  Look at the sample code, I use:

gosub TM_LoadListFromFile c:\testlist.txt ; load a list from file

So it's up to you to use them.  Do a scan of the list functions.  You won't find a single reference to #SHARD or #CHARNAME.  If you're code is doing that, then it's been possessed!

Like I said, I write the tools, you hack them... :p

Sometimes I wonder if you're the one ACTUALLY coding the stuff you code.  hehe  All I'm doing is setting a variable so the name of the text file can be unique for each char on each shard. :)  Then I call the %var.  That SHOULD work fine shouldn't it?  I can switch to another char on the same shard in the same guild and it will drop the .txt extension when saving the file..  Example below.  Is it a file name thing?  Why would it drop the .txt?  Do I need to clean up the name so there's no wierd characters in it? :)

Code: [Select]
 set %saveFileNameShard1 c:\EUO\Target , #shard , #charname , .txt
  set %saveFileNameShard2 c:\EUO\Enemy , #shard , #charname , .txt
  set %saveFileNameShard3 c:\EUO\Friend , #shard , #charname , .txt
  set %saveFileNameShard4 c:\EUO\Potential , #shard , #charname , .txt

  if %saveSelected = 1
    gosub TM_SaveListToFile Newlist1 %saveFileNameShard1
  if %saveSelected = 2
    gosub TM_SaveListToFile Newlist2 %saveFileNameShard2
  if %saveSelected = 3
    gosub TM_SaveListToFile Newlist3 %saveFileNameShard3
  if %saveSelected = 4
    gosub TM_SaveListToFile Newlist4 %saveFileNameShard4

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's List Handling Subs
« Reply #79 on: March 10, 2010, 10:28:53 AM »
0
That's a good place for the #DOT operator:

 set %saveFileNameShard1 c:\EUO\Target , #shard , #charname , #DOT , txt

The problem might be you are switching to a shard that has a space in it i.e. "Napa Valley".  Just have to blame EUO for it's wonky string handling.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #80 on: March 10, 2010, 10:31:25 AM »
0
Ok you're the most loved child again.  I knew it was something like that.  I've actually read that 100 times just never had an opportunity to use it until now.  Thanks. :)  Should I run the file name var through the space to mung sub and back when loading/saving?  I was kidding up there a bit, I thought you were still tipsy from the night before. heh

« Last Edit: March 10, 2010, 10:36:27 AM by Scripty »

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's List Handling Subs
« Reply #81 on: March 10, 2010, 10:38:09 AM »
0
Should I run the file name var through the space to mung sub and back when loading/saving?


Probably should do something like that.  Sometimes I just don't know how EUO is going to react or how its going to effect the DOS box.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #82 on: March 10, 2010, 10:52:58 AM »
0
Should I run the file name var through the space to mung sub and back when loading/saving?


Probably should do something like that.  Sometimes I just don't know how EUO is going to react or how its going to effect the DOS box.

Wouldn't that be a good addition to your subs since it's in there anyways?  Just add a check for spaces in the filename in the save sub and uncheck spaces in the load sub?  If not it's an easy thing for me to do anyways.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's List Handling Subs
« Reply #83 on: March 10, 2010, 11:48:12 AM »
0
Well like I said, I don't put any restrictions on HOW you use them.   A filename is a filename.  I can't really defend against all the strangness that EUO presents, but I can present the basics for everyone to use.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #84 on: March 10, 2010, 12:04:05 PM »
0
Well like I said, I don't put any restrictions on HOW you use them.   A filename is a filename.  I can't really defend against all the strangness that EUO presents, but I can present the basics for everyone to use.

I'll just K.I.S.S. it as EN would say.  Take all that crap out of the names, but I want it to be unique per char, per shard.. hmmm  maybe base it on charid... and drop the shard name? :)

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's List Handling Subs
« Reply #85 on: March 10, 2010, 12:13:51 PM »
0
I have shifted to #CHARID more and more.  I'll be heavily relying on that when I release my new filesystem.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #86 on: March 10, 2010, 12:36:55 PM »
0
I have shifted to #CHARID more and more.  I'll be heavily relying on that when I release my new filesystem.

Thanks for pushing me in the right direction.  That seems to have fixed all my save/load problems. :)

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #87 on: March 12, 2010, 12:08:23 PM »
0
You think in the next version of your list handling subs that you're working on you could make an easy way to find and change the color of a list item? :)  Not the entire list, but individual items.  Maybe store another var? :)  So you can just check it and change it and reset/redraw it...? :)  I've been thinking of a good way to do that with your list subs now, and scanning id's to see if any are onscreen so I can color the ones onscreen to a seperate color.  Then when they leave the screen, reset their bgcolor to white.  Would be easier to have it built in.  As it is now I have to change it and redraw every time I do something.  It's a pain because I have to do it in each individual sub and redraw the menu.  Be nice to have a TM_ChangeListItemColor sub. :) One that stores the color so it persists when you organize menu elements.  Also, what's the fastest way to access all the !tag vars in a list?  For scanning purposes?  I want to iterate through them in the fastest way possible.  Would it just be a for %i 1 %TotalTags?  Using your get tag sub?  I want to use all the id's in a %finditem to see if they are on screen and if they are, color each individual tag in the list to a seperate color.  Be nice an easy with a set list item color sub. :)  for/if sub that changes color of items found in scan, and changes back if not found.  Simple.  Can you even change the background of INDIVIDUAL list items?  I was pretty sure you could... haven't tested yet... I know you can change the background color of the list itself...

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's List Handling Subs
« Reply #88 on: March 12, 2010, 12:22:47 PM »
0
Remember you can't change the color of individual items in a list.  You are limited by the same limitations that EUO has. 
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #89 on: March 12, 2010, 12:53:28 PM »
0
Remember you can't change the color of individual items in a list.  You are limited by the same limitations that EUO has. 

YOU DIDNT EVEN READ THAT WHOLE POST! haha I knew you were doing that...