| Author |
Message |
|
Wildstar
Lieutenant
Joined: Fri Apr 05, 2002 3:00 am Posts: 580 Location: USA
|
Yes,thats right.I am stuck.Liek thats a new one lol.
I hope i am explaining this so everyone can understand.
This routine will be used for lots of stuff,this is an example.
What I want to do is have the script grab information from the screen.Such as planet name or player name.I can do that,but what I want it to do is to display each player or planet individually as I hit a key in the menu.Like if I hit 1 it will cycle through the list then when it hits EOF goto begining.I can get the info.just cant display it.Help is appreciated.
Thanks in advance
_________________ My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.
|
| Wed May 05, 2004 3:28 pm |
|
 |
|
Doctor Who
Lieutenant J.G.
Joined: Wed Feb 06, 2002 3:00 am Posts: 322 Location: United Kingdom
|
quote:Originally posted by Wildstar
Yes,thats right.I am stuck.Liek thats a new one lol.
I hope i am explaining this so everyone can understand.
This routine will be used for lots of stuff,this is an example.
What I want to do is have the script grab information from the screen.Such as planet name or player name.I can do that,but what I want it to do is to display each player or planet individually as I hit a key in the menu.Like if I hit 1 it will cycle through the list then when it hits EOF goto begining.I can get the info.just cant display it.Help is appreciated.
Thanks in advance
the tWGS has no scripting support.. There are probably 10+ popular telnet scripting programs and 2-3 dedicated Tradewars programs that suport scripting. Maybee it would be possible for you to go to the support forums for those specific products that you want to use and ask the questions OR if there is no forum then ask here and say what product you want to use. Simply saying you want a script is not enough information.
_________________ <<Doctor Who>>
|
| Wed May 05, 2004 6:15 pm |
|
 |
|
Wildstar
Lieutenant
Joined: Fri Apr 05, 2002 3:00 am Posts: 580 Location: USA
|
I dont need the script.I just need someone to point me in the right direction.I have it written to grab the info,just dont know how to cycle the display
_________________ My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.
|
| Wed May 05, 2004 7:24 pm |
|
 |
|
typh00n
Chief Warrant Officer
Joined: Sun Mar 30, 2003 3:00 am Posts: 186 Location: USA
|
not sure i understand what you're tryin to do
what would this routine be used for?
|
| Wed May 05, 2004 8:27 pm |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
Okay, let me take a stab in the dark. First guess, we're talking about a TWX script. Second guess, you want to hit 1 to display the first planet, 11 for the first and second planet, 111 for the first 3... and if there were only 3, 1111 would show all three and planet 1 again. Planet file is planets.txt
setvar $planetLine 0
setTextOutTrigger 1 :planets "1"
pause
:planets
add $planetLine 1
read planets.txt $planetToDisplay $planetLine
if ($planetToDisplay = EOF)
setVar $planetLine 1
read planets.txt $planetToDisplay $planetLine
end
echo "*" $planetToDisplay
setTextOutTrigger 1 :planets "1"
pause
You can imagine the problems of having "1" trigger this routine. You definately need a method to disable and enable this trigger, so that it isn't always waiting for "1" to be hit. Am I even close to understanding what you want?
+EP+
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Wed May 05, 2004 9:44 pm |
|
 |
|
Wildstar
Lieutenant
Joined: Fri Apr 05, 2002 3:00 am Posts: 580 Location: USA
|
ok lets try this again lol.The script will do a scan and get information/Like say all the planets in the cj? list.Then display the first one.Then while in the menu you hit the 1 key or what ever number you set it to and it will display the next in the list.so if the list was 1,2,3,4,5,6,7,8,9 10 and you hit the 1 you will first see 1,then hit the 1 again you will see 2 and so on till it gets to 10 then will go back to 1.YOu scroll till you see what you want.Im sure you can see that it can be applied to many scripts,Selecting a planet,A person on line,lots of things.
Hope that made it clearer.Or you can icq me.heh
_________________ My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.
|
| Thu May 06, 2004 12:49 am |
|
 |
|
Wotok
Ensign
Joined: Thu Jan 23, 2003 3:00 am Posts: 206 Location: USA
|
I know what you're wanting. I use the menuing system that the twx proxy scripts use. With that if you hit a letter or number, it will toggle an option usually yes or no. Just add more options.
:sub_SetMenu
setMenuValue "Player" $player[$a]
$player being the array of players (that you'll have to populate) and $a the number of the player in the list
Never tried it that way, maybe it'll work for ya
_________________ --==[ http://tradewars.wotok.com ]==--
rm -rf /bin/laden
|
| Thu May 06, 2004 1:04 am |
|
 |
|
typh00n
Chief Warrant Officer
Joined: Sun Mar 30, 2003 3:00 am Posts: 186 Location: USA
|
i'd use something like this
(untested code, btw)
[assuming the presence of an array, call it $planets]
[assuming ... presence of a var, call it $planetcount (total # of items in $planets)]
:counters
setVar $count 1
:trigs
killalltriggers
setTextOutTrigger display :display "1"
pause
:display
killalltriggers
echo "*" $planets[$count]
add $count 1
if ($count > $planetcount)
setVar $count 1
end
goto :trigs
shouldnt be too hard to modify if you're grabbing from a text file
hope this helps
edited an obvious bug
|
| Thu May 06, 2004 4:50 am |
|
 |
|
Alexio
Chief Warrant Officer
Joined: Mon Oct 07, 2002 2:00 am Posts: 125 Location: USA
|
Darn...
_________________ Alexio just #Ship Destroyed# your Butt! hahahahah
Check out Damage Unlimited Perma Website!!
http://WWW.DAMAGEUNLIMITED.COM
|
| Thu May 06, 2004 4:53 pm |
|
 |
|
PHX
Lieutenant
Joined: Sat Mar 03, 2001 3:00 am Posts: 592 Location: USA
|
OOH OOH I WANNA try
assuming there are only 5 planets in sector
I can't test this right now cause im at work...but i believe it would do the job.
send "lq"
waitfor "("
getword CURRENTLINE $1 2
striptext ")"
waitfor "("
getword CURRENTLINE $2 2
striptext ")"
waitfor "("
getword CURRENTLINE $3 2
striptext ")"
waitfor "("
getword CURRENTLINE $4 2
striptext ")"
waitfor "("
getword CURRENTLINE $5 2
striptext ")"
setvar $nextplanet $1
:top
echo MENU BLAH BLAH
echo "(P)lanet # " & $1
getconsoleinput $cmnd SINGLEKEY
if ($cmnd = "P")
if ($nextplanet = $1)
setvar $nextplanet $2
goto :top
elseif ($nextplanet = $2)
setvar $nextplanet $3
goto :top
elseif ($nextplanet = $3)
setvar $nextplanet $4
goto :top
elseif ($nextplanet = $4)
setvar $nextplanet $5
goto :top
elseif ($nextplanet = $5)
setvar $nextplanet $1
goto :top
end
end
|
| Thu May 06, 2004 7:10 pm |
|
 |
|
PHX
Lieutenant
Joined: Sat Mar 03, 2001 3:00 am Posts: 592 Location: USA
|
Actually...you could change all those "goto :top" 's into just one between the two end lines. But of course my way is not as proficient as the array method. ...haven't learned those yet.
|
| Thu May 06, 2004 7:58 pm |
|
 |
|
PHX
Lieutenant
Joined: Sat Mar 03, 2001 3:00 am Posts: 592 Location: USA
|
I don't know how you could pull people off the # list as there is no trigger to look for that is on every line.
|
| Thu May 06, 2004 8:19 pm |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
Okay, I think this does what you're attempting. Has a nice array and while loop for you to ponder.
Code: :start setVar $count 0 send "lq*" waitOn "Registry# and Planet Name" setTextLineTrigger planet :planet " <" setTextTrigger done :done "Command" pause
:planet getText CURRENTLINE $planetNumber "<" ">" stripText $planetNumber " " add $count 1 setVar $planet[$count] $planetNumber setTextLineTrigger planet :planet " <" pause
:done killTrigger planet setVar $total $count setVar $count 1 echo "*(P)lanet # " & $planet[1] "*" getconsoleinput $cmnd SINGLEKEY upperCase $cmnd while ($cmnd = p) add $count 1 if ($count > $total) setVar $count 1 end echo "*(P)lanet # " & $planet[$count] "*" getconsoleinput $cmnd SINGLEKEY upperCase $cmnd end
To get who's playing, you need to either setup a trigger for each of the possible good and evil titles, or setup a trigger that triggers on anything. That is how the following code works. Code: :whosPlaying setVar $count 0 setTextLineTrigger setup :online "Who's Playing" send "#" pause
:online setTextLineTrigger anything :playerlist setTextTrigger command :done "Command" pause
:playerlist getWord CURRENTLINE $player 1 if ($player = 0) setTextLineTrigger anything :playerlist pause end add $count 1 setVar $online[$count] CURRENTLINE setTextLineTrigger anything :playerlist pause
:done killTrigger anything echo "*Finished" pause
Ofcourse, it builds an array of the info, so you'll need to get familiar with them. You'll probably want to strip corp numbers and titles, but I'll leave that for you to try. Shout if you need help though.
+EP+
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Fri May 07, 2004 1:39 am |
|
 |
|
Alexio
Chief Warrant Officer
Joined: Mon Oct 07, 2002 2:00 am Posts: 125 Location: USA
|
heh, I wasn't going to but I guess I can.....
gonna have to replace the file name with your own...
setVar $count 1
setVar $planet_file GAMENAME & "_planet_creation.txt"
fileExists $exist $planet_file
if ($exist = FALSE)
setVar $planet_type "Update Planet List"
else
while ($check <> "EOF")
add $x 1
read $planet_file $check $x
end
subtract $x 1
read $planet_file $planet_type 1
end
:menu
echo "[2J"
echo "*" ansi_14 "< >" ansi_7 " Planet Type : " ANSI_12 $planet_type "**"
getConsoleInput $selection SINGLEKEY
if (($selection = "<") or ($selection = ">")) and ($Planet_Type = "Update Planet List")
echo ansi_12 "**Planet list needs to be updated first.*"
elseif (($selection = "<") or ($selection = ">")) and ($count = $count)
if ($selection = "<")
setVar $count ($count - 1)
if ($count = 0)
setVar $count $x
end
else
setVar $count ($count + 1)
end
:file_done
read $planet_file $planet_type $count
if ($planet_type = "EOF")
setVar $count 1
goto :file_done
end
end
goto :menu
_________________ Alexio just #Ship Destroyed# your Butt! hahahahah
Check out Damage Unlimited Perma Website!!
http://WWW.DAMAGEUNLIMITED.COM
|
| Fri May 07, 2004 3:06 am |
|
 |
|
Wildstar
Lieutenant
Joined: Fri Apr 05, 2002 3:00 am Posts: 580 Location: USA
|
Thanks guys I will try them out today.This is why the scripters are such great guys.Help everyone else out.Will post if I get it working the way I need it too.You guys rock and thanks again
_________________ My scripts can be downloaded at http://www.grimytrader.com/.
Ore *****.
Even in my signature it's blocked out.
|
| Fri May 07, 2004 9:31 am |
|
 |
|