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

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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
TrailMyx's List Handling Subs
« on: June 09, 2008, 12:22:38 PM »
0
Code: [Select]
;=================================================================
; Script Name: TrailMyx's List Handling Subs
; Author: TrailMyx
; Version: 0.27
; Shard OSI / FS: OSI / FS OK
; Revision Date: 3/12/2008
; Purpose: Take the pain out of managing lists
;
; Subroutines included:
;   TM_CreateList - Creates the list
;   TM_DrawList
;   TM_HideList
;   TM_ReDrawList
;   TM_AddToList
;   TM_DeleteAllItemsInList
;   TM_CopyAllItemsInList
;   TM_DeleteIndexedItemInList
;   TM_DeleteExactItemsInList
;   TM_DeleteExactTagsInList
;   TM_DeleteItemsInList
;   TM_DeleteTagsInList
;   TM_SearchForExactItemInList
;   TM_SearchForExactTagInList
;   TM_SearchForItemInList
;   TM_SearchForTagInList
;   TM_CountExactItemsInList
;   TM_CountExactTagsInList
;   TM_CountItemsInList
;   TM_CountTagsInList
;   TM_AlphabetizeList
;   TM_GetSelectedItem
;   TM_GetSelectedTag
;   TM_GetIndexedItem
;   TM_GetIndexedTag
;   TM_GetListSize
;   TM_MoveSelectedItemDown
;   TM_MoveSelectedItemUp
;
; Requirements:
;
; Locals/Globals:
;   TM_window_list_ , %2 (local)
;
; Special Thanks:
;
;=================================================================
;

Note: Version 31 saves information to the registry and not a flat file.  However it's much faster.

There are 3 attachment(s) in this post. You must register and post an acceptable introduction to download
tool_listhandler28.txt
tool_listhandler29.txt
tool_listhandler31.txt
« Last Edit: July 09, 2021, 12:00:21 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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 #1 on: November 03, 2008, 08:45:25 PM »
0
Was just playing with these subs a bit and decided to add something that Khameleon was talking about way back on uocoders.  He was thinking it would be nice to allow for the script to track not only the visible list item, but also an additional piece of data that won't be displayed.  So here's a sample of what I'm talking about:

Code: [Select]
set %font_arial MS , #SPC , Ariel
gosub showEUOMenu1
gosub TM_CreateList List Newlist1 4 4 345 289 White WindowText %font_arial 8
set #LPC 100
repeat
  finditem * G_18
  if #FINDKIND <> -1
  {
    event property #FINDID
    str pos #PROPERTY $
    set #STRRES #STRRES - 1
    str left #PROPERTY #STRRES
    gosub TM_AddToList Newlist1 #STRRES #FINDID
    ignoreitem #FINDID
  }
until #FALSE
stop
;--------- EasyUO Menu Designer Code Begin ---------
sub showEUOMenu1
menu Clear
menu Window Title Test
menu Window Color BtnFace
menu Window Size 442 298
menu Show 421 270
return
;--------- EasyUO Menu Designer Code End ---------

This code will save all incoming items it finds on the ground and places them into the list you can see.  It also makes a note of the #FINDID associated with the item.  You can go back later and do searches on either the "Items" information or the "Tag" information.  Where:

Item = displayable
Tag = non-displayable

So specifically, the syntax to add the item text and tag looks like:

Code: [Select]
gosub TM_AddToList Newlist1 #STRRES #FINDID ; added the 3rd argument (the Tag)

About NODRAW lists:

Normally these subs are meant to replace instances of menu list or menu combo, but there are times when you might want to use a list as a data structure to generally hold information.  For that you can:

Code: [Select]
gosub TM_CreateList NODRAW Newlist2 110 10 100 100 White WindowText %font_arial 8

This will create a list, but not associate it with anything on the screen.  Be sure to have a unique name, i.e. you cannot have a NODRAW list named NewList2 and a Combo List NewList2.
Be looking for version 2.1 of this set of subs.  I'm playing with them now and will post them soon.  Not that anyone uses them, but what the heck.
« Last Edit: December 07, 2008, 06:41:32 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: TrailMyx's List Handling Subs
« Reply #2 on: November 04, 2008, 02:13:23 PM »
0
I use em :P
I haven't really the time to sit down and write a full blown script in a while... to many annoying variables in the background atm.

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: TrailMyx's List Handling Subs
« Reply #3 on: February 23, 2009, 02:05:07 PM »
0
oh Man, I didn't see this update I was about to tear my hair out trying to handle to forms of lists. now this will definitely work.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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 #4 on: February 23, 2009, 02:09:00 PM »
0
Ya, that sample code makes it pretty clear what will be displayed and what will be tracked.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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 #5 on: June 10, 2009, 08:54:36 PM »
0
Updated to 0.23

I realized I didn't write two necessary functions for selecting the selected item and selected tag from the list.  Add 2 new functions:

TM_GetSelectedItem
TM_GetSelectedTag
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #6 on: February 26, 2010, 11:27:15 AM »
0
I just fell in love with you all over again.  Thanks for making this TM.  Be prepared for ?'s. :)  Looks pretty self explanatory tho.  Just tested and added the ID and TYPE to the list behind the parsed name... now it's a all item id identifyer within range. :)  Love it.  Going to see about making a dynamic targetting menu... We'll see.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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 #7 on: February 26, 2010, 12:21:55 PM »
0
I have some added functionality that I need to post up.  If you want to see the latest and greatest versions, look in the MIB hunter script.  Also there's some good examples in there.  IN the mean time, I'll try and get these revised since I did find some bugs.  But since only Kham and I used these, I didn't feel all that motivated to fix'em.

If you like these, then you'll really like my next project.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #8 on: February 26, 2010, 12:29:15 PM »
0
But since only Kham and I used these, I didn't feel all that motivated to fix'em.
If you like these, then you'll really like my next project.  ;)

I can't believe only you two used these... these are HORRIBLY usefull. :)  Especially if you like nice menus! heh  I gotta look into selecting menu items... I haven't decided if I want to make the list update dynamically.. which would be NICE, but might not be as usefull as a list you can EDIT, and move names around... Is there a sub in there that will let you order them the way you like besides alphabetical?  I didn't look. :)  Move up and down list... then you could prioritize lists based on your preference...  I have a feeling you added that functionality without me looking to see, because we were discussing the other night how all your stuff has what you need and the kitchen sink usually... heh

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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 #9 on: February 26, 2010, 12:39:06 PM »
0
Lol, well with code like this, it's easy to leave out that totally necessary sub.  It's only when you get into it on a project basic and realize, "Oh crap, I forgot to add access to this stuff!"  So thanks to the MIB hunter that brought out the additional functionality need.

But unfortunately, most scripters don't really try to push the envelop of their UIs.  That's kinda what my next project is all about.  If I can get this new job locked down, I'll probably have more time to play with things like this.  This kinda came from my experience with the CLAw.  However, I didn't have these routines during that time.  Shame, it would be nice to stub them in there.

Did you manage to get them working somewhat?
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #10 on: February 26, 2010, 12:54:37 PM »
0
Did you manage to get them working somewhat?

Somewhat?  Just using 2 of the subs I've done most of what I want.  When I add saving and editing of the list... it will be amazing. :)  How can I access the data I save for each instance in the list?  Ah, I see the #findid in the third tag is EXACTLY what is needed. I'm luvin it.  You say you can't display the #findid... but you can... I did in my lists... I displayed the item, and the #findid and the #findtype in the list... :)

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #11 on: February 26, 2010, 12:57:04 PM »
0
I'm also sorting the lists, I'll have 4 I think, based on #findrep and things I determine in #property when it scans.  2 of the lists will be hidden because they really aren't necessary... but I'll add the functionality and play with it till I come up with better ideas for it.  I know I'll have ideas for the 2 hidden lists eventually. :)  I hate "WHY DIDNT YOU ADD *insert someones great idea*"  stuff.  So I try to plan for it. heh

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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 #12 on: February 26, 2010, 12:57:43 PM »
0
Well it's totally up to you what goes into the visible part of the list.  The "tag" part is really there for you to compare against for searching or other reference.  It's the programmers choice for the visible part.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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 #13 on: February 26, 2010, 02:00:54 PM »
0
Ok, so sometimes I need a prompting to get something going.  I've had a few new unpublished version of these subs, and I just merged the bug fixes that I found from another project.  The notable additions are:

;   TM_GetIndexedItem
;   TM_GetIndexedTag
;   TM_GetListSize

Also I fixed a few places where the #LPC might run away and not get reset.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's List Handling Subs
« Reply #14 on: February 26, 2010, 02:32:35 PM »
0
Ok, so sometimes I need a prompting to get something going.  I've had a few new unpublished version of these subs, and I just merged the bug fixes that I found from another project.  The notable additions are:

;   TM_GetIndexedItem
;   TM_GetIndexedTag
;   TM_GetListSize

Also I fixed a few places where the #LPC might run away and not get reset.

I have a bad habit of writing without thinking.  And having to go back and do it all again with a new and better idea.  I'm starting to hate you for making me love dynamic menu lists... :)  Thanks for updating that tho.  GetIndexTag is EXACTLY what I freakin need. :)  I need to check those out.  So if I were to use menu get "menu name" and the menu item selected was 3?  Could I just do getindexeditem 3?  Is that how that works?  Just guessing without looking. :)  Get list size is for scanning through the list somehow I'm guessing, so you don't just scan indefinately... heh