| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Menu Problem https://mail.black-squirrel.com/viewtopic.php?f=15&t=13020 |
Page 1 of 1 |
| Author: | Wildstar [ Wed May 05, 2004 3:28 pm ] |
| Post subject: | |
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 |
|
| Author: | Doctor Who [ Wed May 05, 2004 6:15 pm ] |
| Post subject: | |
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. |
|
| Author: | Wildstar [ Wed May 05, 2004 7:24 pm ] |
| Post subject: | |
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 |
|
| Author: | typh00n [ Wed May 05, 2004 8:27 pm ] |
| Post subject: | |
not sure i understand what you're tryin to do what would this routine be used for? |
|
| Author: | ElderProphet [ Wed May 05, 2004 9:44 pm ] |
| Post subject: | |
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+ |
|
| Author: | Wildstar [ Thu May 06, 2004 12:49 am ] |
| Post subject: | |
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 |
|
| Author: | Wotok [ Thu May 06, 2004 1:04 am ] |
| Post subject: | |
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 |
|
| Author: | typh00n [ Thu May 06, 2004 4:50 am ] |
| Post subject: | |
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 |
|
| Author: | Alexio [ Thu May 06, 2004 4:53 pm ] |
| Post subject: | |
Darn... |
|
| Author: | PHX [ Thu May 06, 2004 7:10 pm ] |
| Post subject: | |
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 |
|
| Author: | PHX [ Thu May 06, 2004 7:58 pm ] |
| Post subject: | |
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. |
|
| Author: | PHX [ Thu May 06, 2004 8:19 pm ] |
| Post subject: | |
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. |
|
| Author: | ElderProphet [ Fri May 07, 2004 1:39 am ] |
| Post subject: | |
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+ |
|
| Author: | Alexio [ Fri May 07, 2004 3:06 am ] |
| Post subject: | |
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 |
|
| Author: | Wildstar [ Fri May 07, 2004 9:31 am ] |
| Post subject: | |
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 |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|