Author Topic: Cerv's Tracking List  (Read 5929 times)

0 Members and 1 Guest are viewing this topic.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Cerv's Tracking List
« on: August 08, 2011, 05:08:08 PM »
0
Code: [Select]
;=========================================
; Script Name: Cerv's Tracking List
; Author: Cerveza
; Version: No version.
; Shard OSI / FS: ONLY tested OSI
; Revision Date: 08 Aug 2011
; Public Release: v1.0
;=========================================
; Purpose:
;   Keep a listing of tracked players
; Requirements:
;   Tracking skill would be nice
;   KalOCR must be in default directory
;=========================================;
;    ____         _      _  __   _____    ;
;   / __/ ___ _ _(_)_ __| |_\ \ / / _ \   ;
;   \__ \/  _| `_| | ` \   _/ / \ \/ \ \  ;
;   __/  \ (_| | | | |) | | \ \_/ /\_/ /  ;
;   \____/\__|_| |_|  _/|_|  \___/\___/   ;
;                  |_|ScriptUO.com        ;
;=========================================;

Will list players found using the tracking skill.

I need a little help with this one. The script works great as is, but I'd really like to include newly found people on the top of the list instead of having them added to the bottom. When added to the bottom you always have to pull down the side thing to see the latest. I'd really like the newest to be visible on the top of the list.

I know someone out there knows how to do this... please pass the info along, it would really make this a slick tool.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
Cerv's Tracker List.txt
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Neo

  • Prime Program
  • Elite
  • *
  • *
  • Posts: 821
  • Activity:
    0%
  • Reputation Power: 13
  • Neo barely matters.Neo barely matters.
  • Respect: +155
  • Referrals: 3
    • View Profile
Re: Cerv's Tracking List
« Reply #1 on: August 09, 2011, 10:04:58 AM »
0
Hi Cerveza, first of all, great script...

I was thinking about what you said of adding the names on top of the list, and this is what I came up with:

Code: [Select]
set #lpc 4000
set %listcnt 1  ;listcnt is what's going to keep track of created "lists"
gosub showmenu

repeat
gosub doit
wait 3s ; 7 second timout in gumpwait
until #false

sub doit
event macro 13 38 ; use skill tracking
gosub TM_GumpWait generic_gump
gosub offsetclick 337 123 l
gosub TM_GumpWait generic_gump
if #result = #FALSE
  return
call kalocr.txt getTrackingInfo #contposX #contposY #contsize
for %i 1 !tgi_cnt
  {
  set %name !tgi_name . %i ; note the "dot"
  set %list . %listcnt %name
  set %listcnt %listcnt + 1 ; lists will be named %list1, %list2 , ... , %listn
  }
menu delete list
menu List Create list 0 0 199 353
for %n %listcnt 1 ; so the previous list will be deleted, and a new one will be created
  {               ; in this order: %listn, %listn-1 , ... , %list1
  if %list . %n <> N/A ;a safety check to avoid N/A's in your list
  menu list add list %list . %n ;lists every list backwards
  }
gosub offsetclick 1 1 r
wait 7s
return

;-------------------------------------------------------------------------------
sub OffsetClick
  set %tempx %1 + #CONTPOSX
  set %tempy %2 + #CONTPOSY
  click %tempx %tempy %3
return

;-------------------------------------------------------------------------------
; %1 = Gumpname 1
; %2 = Gumpname 2
; #TRUE gump occured before timeout
sub TM_GumpWait
  namespace push
  namespace local GW
  wait 10
  set !timedelay #SCNT
  while #SCNT <= !timedelay + 7
  {
    if #CONTNAME = %1 || #CONTNAME = %2
    {
      namespace pop
      return #TRUE
    }
  }
  namespace pop
return #FALSE

sub showmenu
menu Clear
menu Window Title Cerv's Tracker List
menu Window Color BtnFace
menu Window Size 200 387
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu Font Align Left
menu Font Name Courier New
menu Font Size 10
menu Font Color Black
menu Font BGColor Window
menu List Create list 0 0 199 353
menu Show 421 270
return
I've added comments on the lines I changed... Hope this is what you meant, and if it is, hope you find this useful! :)

Cheers!

EDIT: found a minor issue, should be fixed now
« Last Edit: August 09, 2011, 11:28:06 AM by frneo »
Never refuse an invitation.
Never resist the unfamiliar.
Never fail to be polite.
And never outstay your welcome.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Cerv's Tracking List
« Reply #2 on: August 09, 2011, 10:17:36 AM »
0
Cool, I'll play with it some tonight. Appreciate the help with that.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Cerv's Tracking List
« Reply #3 on: August 16, 2011, 04:43:54 PM »
0
Working awesome!

Now, let's get the time for each "hit" ?
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Neo

  • Prime Program
  • Elite
  • *
  • *
  • Posts: 821
  • Activity:
    0%
  • Reputation Power: 13
  • Neo barely matters.Neo barely matters.
  • Respect: +155
  • Referrals: 3
    • View Profile
Re: Cerv's Tracking List
« Reply #4 on: August 16, 2011, 04:53:13 PM »
0
Working awesome!

Now, let's get the time for each "hit" ?
That would be nice!

I was also thinking that it would be cool to add a way to not repeat names...

For instance, if you tracked PlayerA, PlayerB, PlayerC the first time around... Next time you track you get PlayerB, PlayerC and PlayerD... It would then delete PlayerB and PlayerC from the back of the list and add them on top, together with PlayerD... And leave just PlayerA back there... That way, you would get the last tracked time for each player, without all those repeated names in the list...
Never refuse an invitation.
Never resist the unfamiliar.
Never fail to be polite.
And never outstay your welcome.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Cerv's Tracking List
« Reply #5 on: August 16, 2011, 05:12:34 PM »
0
Ahhh, nice thinking!
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Neo

  • Prime Program
  • Elite
  • *
  • *
  • Posts: 821
  • Activity:
    0%
  • Reputation Power: 13
  • Neo barely matters.Neo barely matters.
  • Respect: +155
  • Referrals: 3
    • View Profile
Re: Cerv's Tracking List
« Reply #6 on: August 16, 2011, 09:44:17 PM »
0
I think I came up with something Cerveza. Check it out:
Code: [Select]
;=========================================
; Script Name: Cerv's Tracking List
; Author: Cerveza
; Version: No version.
; Shard OSI / FS: ONLY tested OSI
; Revision Date: 08 Aug 2011
; Public Release: v1.0
;=========================================
; Purpose:
;   Keep a listing of tracked players
; Requirements:
;   Tracking skill would be nice
;=========================================;
;    ____         _      _  __   _____    ;
;   / __/ ___ _ _(_)_ __| |_\ \ / / _ \   ;
;   \__ \/  _| `_| | ` \   _/ / \ \/ \ \  ;
;   __/  \ (_| | | | |) | | \ \_/ /\_/ /  ;
;   \____/\__|_| |_|  _/|_|  \___/\___/   ;
;                  |_|ScriptUO.com        ;
;=========================================;
set #lpc 4000
set %namecnt 0
gosub showmenu

repeat
gosub doit
wait 3s ; 7 second timout in gumpwait
until #false

sub doit
event macro 13 38 ; use skill tracking
gosub TM_GumpWait generic_gump
gosub offsetclick 337 123 l
gosub TM_GumpWait generic_gump
if #result = #FALSE
  return
call kalocr.txt getTrackingInfo #contposX #contposY #contsize
set %oldnamecnt %namecnt
for %i 1 !tgi_cnt
    {
    set %namecnt %namecnt + 1
    set %name . %namecnt !tgi_name . %i
    gosub gettime
    set %ctime . %namecnt #result
    }
set %oldnamecnt1 %oldnamecnt + 1
for %n %oldnamecnt1 %namecnt
    {
    for %o 0 %oldnamecnt
        {
        if %name . %o = %name . %n
           {
           set %name . %o N/A
           }
        }
    }
menu delete list
menu List Create list 0 0 224 353
for %p %namecnt 1
    {
    if %name . %p <> N/A
       {
       menu list add list %name . %p , #spc , @ , #spc , %ctime . %p
       }
    }
gosub offsetclick 1 1 r
wait 7s
return

;-------------------------------------------------------------------------------
sub gettime
namespace push
namespace local ct
set !string #time
str left !string 2
set !h #strRes
str Mid !string 3 2
set !m #strRes
str Right !string 2
set !s #strRes
if !h < 12
   {
   set %meridiem AM
   }
if !h >= 12
   {
   set %meridiem PM
   if !h >= 13
      {
      set !h !h - 12
      }
   }
set !hour !h , :
set !min !m , :
set !sec !s
set !ctime !hour , !min , !sec , #spc , %meridiem
set #result !ctime
namespace pop
return #result
;-------------------------------------------------------------------------------
sub OffsetClick
  set %tempx %1 + #CONTPOSX
  set %tempy %2 + #CONTPOSY
  click %tempx %tempy %3
return

;-------------------------------------------------------------------------------
; %1 = Gumpname 1
; %2 = Gumpname 2
; #TRUE gump occured before timeout
sub TM_GumpWait
  namespace push
  namespace local GW
  wait 10
  set !timedelay #SCNT
  while #SCNT <= !timedelay + 7
  {
    if #CONTNAME = %1 || #CONTNAME = %2
    {
      namespace pop
      return #TRUE
    }
  }
  namespace pop
return #FALSE

sub showmenu
menu Clear
menu Window Title Cerv's Tracker List
menu Window Color BtnFace
menu Window Size 225 387
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu Font Align Left
menu Font Name Courier New
menu Font Size 10
menu Font Color Black
menu Font BGColor Window
menu List Create list 0 0 224 353
menu Show 421 270
return
I had to change the structure a little bit, but it seems to be working nicely...

EDIT: Seconds timer had a typo, seems perfect now! :)
« Last Edit: August 17, 2011, 08:10:56 AM by frneo »
Never refuse an invitation.
Never resist the unfamiliar.
Never fail to be polite.
And never outstay your welcome.

Offline NObama

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Cerv's Tracking List
« Reply #7 on: August 16, 2011, 10:07:14 PM »
0
You're going to use his to auto-page on people who page on you, i just know it!


Offline MeWonUo

  • Hero Member
  • *
  • Posts: 913
  • Activity:
    0%
  • Reputation Power: 11
  • MeWonUo barely matters.MeWonUo barely matters.
  • Gender: Male
  • Respect: +85
  • Referrals: 1
    • View Profile
Re: Cerv's Tracking List
« Reply #8 on: August 16, 2011, 10:18:08 PM »
0
You're going to use his to auto-page on people who page on you, i just know it!



 ;D  Now that would be absolutely hilarious!

Offline Neo

  • Prime Program
  • Elite
  • *
  • *
  • Posts: 821
  • Activity:
    0%
  • Reputation Power: 13
  • Neo barely matters.Neo barely matters.
  • Respect: +155
  • Referrals: 3
    • View Profile
Re: Cerv's Tracking List
« Reply #9 on: August 16, 2011, 10:20:48 PM »
0
You're going to use his to auto-page on people who page on you, i just know it!


lol that would be awesome!
Never refuse an invitation.
Never resist the unfamiliar.
Never fail to be polite.
And never outstay your welcome.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Cerv's Tracking List
« Reply #10 on: August 21, 2011, 11:20:16 AM »
0
Ok, finally got a chance to try this, working really slick. This is how I envisioned this script working! Great job frneo!
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Tags: