View unanswered posts | View active topics It is currently Thu Apr 30, 2026 10:47 am



Reply to topic  [ 4 posts ] 
 twx corp member array 
Author Message
Lieutenant

Joined: Sat Mar 03, 2001 3:00 am
Posts: 592
Location: USA
Unread post 
ok heres a piece of script to capture corp member names, I want to set an array holding all the name and i don't know jack about arrays?

btw this runs from citadel not Command hence the "x" instead of "t"

Code:
    setvar $corpies ""
    setvar $line ""
    setvar $var 0
    send "/x aq "
    :quickstats
        settextlinetrigger qs_line1 :qs_line #179
        settextlinetrigger qs_line2 :qs_line "Ship "
        pause
        :qs_line
            killtrigger qs_line1
            killtrigger qs_line2
            setvar $line $line & CURRENTLINE
            getwordpos $line $pos "Ship"
            if ($pos = 0)
                goto :quickstats
            end
            replacetext $line #179 " "
            striptext $line ","
            while ($var < 6)
                replacetext $line "  " " "
                add $var 1
            end
        gettext $line $exp "Exp " " Corp"
        if ($exp = "")
            gettext $line $exp "Exp " " Ship"
            setvar $corp 0
        else
            gettext $line $corp "Corp " " Ship"
        end
    waitfor "------------------------------------------------------------------------------"
    :corp_list
        settextlinetrigger corp_member :corp_member
        pause
    :corp_member
        setvar $line currentline
        if ($line = "") or ($line = "P indicates Trader is on a planet in that sector")
            pause
        end
        cuttext $line $corpie 1 38
        striptext $corpie " "
        setvar $corpies $corpie & " " & $corpies
        goto :corp_list
    :set_corpie_array


Tue Jul 25, 2006 7:01 pm
Profile ICQ YIM WWW
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
A modded version of Oz's stbot corpie grabber code... that I've used is:

Code:
:getCorpies
   setVar $corpyCount 0
        send "* "
   waitFor "(?="
   getWord CURRENTLINE $location 1
   if ($location = "Citadel") or ($location = "Command")
      goto :grabCorpies
   else
      halt
   end
:grabCorpies
   if ($location = "Citadel")
      send "xaq"
   elseif ($location = "Command")
      send "taq"
   end
   WaitFor "--------------------------"
:parseCorpies
   setTextLineTrigger corpies :corpies ""
   pause
:corpies
   getWord CURRENTLINE $corpy_prompt_ck 1
   if ($corpy_prompt_ck = "Corporate") or ($corpy_prompt_ck = 0) or ($corpy_prompt_ck = "P")
      goto :doneWithCorpies
   end
   add $corpyCount 1
   cutText CURRENTLINE $corpy[$corpyCount] 1 39
   setVar $pos 38
:stripCorpies
   cutText $corpy[$corpycount] $blank_ck $pos 1
   if ($blank_ck = " ")
      cutText $corpy[$corpyCount] $corpy[$corpyCount] 1 $pos
      subtract $pos 1
      goto :stripCorpies
   else
      cutText $corpy[$corpyCount] $corpy[$corpyCount] 1 $pos
      saveVar $corpy[$corpycount]
      saveVar $corpyCount
      goto :parseCorpies
   end

:doneWithCorpies
   return


In my saveme I used...

Code:
# Get corpie list
setVar $corpie_idx 0
send "xaq"
waitFor "Corporate command [TL="
waitFor "--------------------------------------"
killtrigger corpie_catcher
setTextLineTrigger corpie_catcher :catch_corpie ""
pause

:catch_corpie
killtrigger corpie_catcher
getWordPos CURRENTLINE $test1 "indicates Trader is on a planet in that sector"
getWordPos CURRENTLINE $test2 "Corporate command"
if ($test1 > 0) OR ($test2 > 0)
     goto :got_corpies
end
getLength CURRENTLINE $size_test
if ($size_test <= 40)
     goto :got_corpies
end
cutText CURRENTLINE $corpiename 1 6
add $corpie_idx 1
setVar $corpies[$corpie_idx] $corpiename
setTextLineTrigger corpie_catcher :catch_corpie ""
pause

:got_corpies
setVar $corpie_max $corpie_idx

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Tue Jul 25, 2006 11:35 pm
Profile ICQ WWW
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post 
Seems we have daybirds and nightbirds so ill do one class for each group

_________________
Coconut Telegraph (ICQ)#586137616
Team Speak3@ 220.244.125.70:9987
Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
Image
Jesus wounldn't Subspace Crawl


Wed Jul 26, 2006 12:18 am
Profile ICQ YIM
Lieutenant

Joined: Sat Mar 03, 2001 3:00 am
Posts: 592
Location: USA
Unread post 
oK HERE tis...

i took out the striptext " " because that could cause issues where people use spaces in their names. I used another method to take all the extra spaces off the end of the names. I also took out the quickstat sequence as that is not even a factor and is unchanged anyhow.

thanx Sing


Code:
send "x aq "
    setvar $pos 0
    waitfor "Corp Member Name"
    waitfor "------------------------------------------------------------------------------"
    :corp_list
        settextlinetrigger corp_member :corp_member
        pause
    :corp_member
        setvar $line currentline
        if ($line = "") or ($line = "P indicates Trader is on a planet in that sector")
            goto :planet
        end
        cuttext $line $corpie 1 38
        setvar $i 37
        cuttext $corpie $check $i 1
        while ($check = " ")
            subtract $i 1
            cuttext $corpie $check $i 1
        end
        cuttext $corpie $corpie 1 $i
        add $pos 1
        setvar $corpie[$pos] $corpie
        goto :corp_list


Wed Jul 26, 2006 2:09 am
Profile ICQ YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.