--


  << Previous Topic | Next Topic >>Return to Index  

scripting help

January 5 2002 at 9:28 PM
 

-
I'm still new to writing my own scripts but I am trying to learn the rexx language in my spare time,
I am trying to put together a script to transfer fighters between two sectors, and I'm not quite sure how to tell the script to pull the number available in the sector and what amount to leave, any help would be greatly appreciated...

Example:
You have 5,000,000 fighters available
How many fighters would you like defending this sector
your ship can support 20,000 leaving 4,980,000

I need to pull both the number available and the number I can leave behind but I 'm not sure just how to command rexx to pull both amounts any ideas or suggestions?...

If I can get this script put together and working I will be more then happy to post it to the Attac script page to share...

 
 Respond to this message   
AuthorReply

re: scripting help

January 8 2002, 5:51 AM 

off of the top of my head...

call ZocWait("You have ")
call ZocWait("fighters")
fig_avail = get_int_from_lastline

call ZocWait("leaving ")
call ZocWait("^M")
min_to_leave = get_int_from_lastline

exit

get_int_from_lastline:
 int_final=""
 Call ZocWaitMux("]", " ", "^M")
 lastline = ZocLastLine()

 DO pos = 1 to length(lastline)
  ch = substr(lastline, pos, 1)
  if ch <> "]" || ch <> " " || ch <> "^M" then DO
   if ch <> "," then int_final = int_final || ch
  END
 END
RETURN int_final

 
 Respond to this message   

Thanks,

January 8 2002, 1:52 PM 

Thanks Peanut I think this will do the trick btw keep up the great work I love Attac...

 
 Respond to this message   
Current Topic - scripting help
  << Previous Topic | Next Topic >>Return to Index  
Find more forums on Tradewars 2002Create your own forum at Network54
 Copyright © 1999-2008 Network54. All rights reserved.   Terms of Use   Privacy Statement