| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| 2_Worldtrade.ts https://mail.black-squirrel.com/viewtopic.php?f=15&t=26319 |
Page 1 of 1 |
| Author: | Timberwolf [ Mon Jul 05, 2010 6:21 pm ] |
| Post subject: | 2_Worldtrade.ts |
I need to add some coding to the 2_Worldtrade.ts script that came with TWX proxy that would terminate the script if I get too low on turns, say 50 turns. I was using it today and I looked away for a minute and when I looked back my turns was down to zero. Thankfully no one else was on and I patiently waited for my turns to come back at the top of the hour and limped home. I also need to use this same coding for a custom colonizing script that I'm writing. I want that script to terminate as well if the turns get too low. I'm told Mombot will monitor that, but I think Mombot only monitors its own scripts and not the outside scripts. I could be wrong. I did have Mombot running when I ran this worldtrade script and it was set for 50 turns, but I guess that didn't work. Any help is appreciated and thank you. |
|
| Author: | Helix [ Mon Jul 05, 2010 7:44 pm ] |
| Post subject: | Re: 2_Worldtrade.ts |
so something like if turns > 51 continue, else halt? so you would have to get the number of turns, throw them in a variable. Where would you want to do the check? Before porting? Before moving? After porting? All of those? Lets work out the algorithm then put it together. <digging out the script.html> setVar $t = 0 //set turns variable to 0 //get current turns however (maybe using / to grab the current number of turns), then $t = $ct //turns = current turns IF ($t =< 50) // if the turns are greater than fifty one HALT ELSE //continue trading END H |
|
| Author: | Timberwolf [ Mon Jul 05, 2010 7:51 pm ] |
| Post subject: | Re: 2_Worldtrade.ts |
I would have to say after porting and before moving to the next port. That line would be similar to what I have in mind. |
|
| Author: | Vid Kid [ Mon Jul 05, 2010 9:31 pm ] |
| Post subject: | Re: 2_Worldtrade.ts |
Since you mentioned you are using mom bot , you can loadvar unlim determine if its true or false ... If false & not "0" Get user input st (stop at turns) use the include playerinfo and pull your turns with a gosub to it set var ct (current turns) Else setvar ct 99999 End then in begining of work loop gosub playerinfo set ct playerinfo~turns IF ($ct <= $st) echo "*reached turn limit of "& $ct halt end / rest of script here |
|
| Author: | Kaus [ Mon Jul 05, 2010 9:45 pm ] |
| Post subject: | Re: 2_Worldtrade.ts |
if you dont want to depend on mombot (while easier) you could use dynarri's quickstats found at http://www.navhaz.com (opensource). Then you just check against that the quickstats routine. #Set your minimum turn variable with a number |
|
| Author: | Helix [ Mon Jul 05, 2010 10:48 pm ] |
| Post subject: | Re: 2_Worldtrade.ts |
Since Sing does't have it as a stand alone .ts file, I pulled it out of one of the dny scripts # ------------------------------------------------------------------- |
|
| Author: | Kaus [ Mon Jul 05, 2010 11:12 pm ] |
| Post subject: | Re: 2_Worldtrade.ts |
Helix wrote: Since Sing does't have it as a stand alone .ts file, I pulled it out of one of the dny scripts My bad I thought it was in a standalone version. Either way quickstats is my preferred method to pull player stats as it doesn't depend on any single script loading right. Off topic personally I like to leave the authors headers in, reminds me who to thank for the routine /Double offtopic sorta: is the mombot unlimited check variable named $Unlim and is it a SaveVar? P.s. I recommend both using TWXIDE.exe as the text editor (I recommend it highly) or using http://www.navhaz.com/files/script.html as reference for your colonizing script. Makes life much easier to have a quick reference that you don't have to load from within a script directory. |
|
| Author: | Vid Kid [ Mon Jul 05, 2010 11:47 pm ] |
| Post subject: | Re: 2_Worldtrade.ts |
My mention of the mom bot was as to the .cfg variable it saved for the Unlim status. and to use it , you LoadVar $Unlim (as mentioned by someone above) and as for the quick stats , that would add alot of extra code to your script verses Gosub : PlayerInfo~InfoQuick SetVar $ActualTurns $PlayerInfo~Turns just my prefs. |
|
| Author: | booger [ Tue Jul 06, 2010 12:07 am ] |
| Post subject: | Re: 2_Worldtrade.ts |
while i see why you would do this, i dont run 2_worldtrade if im AFK. it can get you podded... |
|
| Author: | Timberwolf [ Tue Jul 06, 2010 12:20 am ] |
| Post subject: | Re: 2_Worldtrade.ts |
That it does, Booger. It's so fast that I looked away for a moment when I was down to about 200 turns and a moment was all it took for me to get right down to zero. Crap happens Anyways, I appreciate the effort from all of you for providing the code snippets. Thanks |
|
| Author: | booger [ Tue Jul 06, 2010 12:26 am ] |
| Post subject: | Re: 2_Worldtrade.ts |
that fast? wow your system must be smoking... i try to stay out of turn games too... so tha tisnt an issue as much... |
|
| Author: | Timberwolf [ Tue Jul 06, 2010 12:38 am ] |
| Post subject: | Re: 2_Worldtrade.ts |
I remember the old days when it would take me a while to run 700-1000 turns on dial up and with slow scripts (TWAR for Windows anyone?) Now these days, I can blow through 1000-1500 turns in no time at all. I can see why high turn games are so prevalent these days. But once again, thanks for the snippets, guys. I'm heading to bed and will look at them tomorrow |
|
| Author: | Parrothead [ Sun Oct 17, 2010 4:42 pm ] |
| Post subject: | Re: 2_Worldtrade.ts |
Mombot :quikstats goes into endless loop under certain conditions turns = 0...turns game...at least it does in the beta twgs |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|