View unanswered posts | View active topics It is currently Sun Dec 28, 2025 4:00 pm



Reply to topic  [ 5 posts ] 
 RANDOM AND ARRAY (Final JAM) 
Author Message
Gameop
User avatar

Joined: Mon Jan 26, 2009 12:27 am
Posts: 123
Unread post RANDOM AND ARRAY (Final JAM)
Hi, Finaly I made it. My random can now randomize and redo the random if a certain of numbers are repeated too much.

My last bug, is again the way to put an "*" if some values in TEDIT had the same number of digits...
TEDIT example
In Planet Editor, if the max number is 20000, when you put more than 9999, you do not need to do "*" .

So now my problem is that in my script my max number isn't always the same, it's depending of the Planet Class.

Someone got an idea... to do it shortly, cause I thought about a manner to do it, but it will add a lot of lines to my script and I believe that an advanced scripter or an expert scripter will be able to do it with lesser than my idea.

_________________
Dodger known as Yop Solo, Sysop
twgsdodgerbbs.ath.cx
http://cyberquebec.ca/_layout/?uri=http://cyberquebec.ca/twgsdodgerbbs/


Sun Mar 22, 2009 9:48 am
Profile
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post Re: RANDOM AND ARRAY (Final JAM)
Not too sure if I am understanding correctly, but you are talking about the number of characters and when the enter key is needed or not, correct?

If so, I encountered a similar issue and Promethius was kind enough to teach me about this. I can show you an example from my OCSBot Patrol script.

Code:

readtoarray $SentryFile $SentryCount
   setVar $i 2
   while ($i <= $SentryCount)
        send "s" 
        WaitFor "Sector number (0="
        send $SentryCount[$i]
        getLength $sentryCount[$i] $len
        if ($len < 5)
            send "*"


I have the course from Sector 1 to StarDock going into a file called SentryList.txt which gets read into the $SentryCount var. I had to use the getLength command, then tell it if the length was less than 5 characters (ex: sector 10001), then send the enter key.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Sun Mar 22, 2009 11:02 am
Profile
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1400
Location: Canada
Unread post Re: RANDOM AND ARRAY (Final JAM)
Code:
if ($PLANET_NUMBER_IDX <= 9999)
    send $PLANET_NUMBER_IDX & "*"
else
    send $PLANET_NUMBER_IDX
end

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
-= There are 10 types of people in the world: Those that understand Binary and those who do not
-= If Oil is made from Dinosaurs, and Plastic is made from Oil... are plastic Dinosaurs made from real Dinosaurs?
-= I like to keep my friends and my enemies rich, and wait to see which is which - Tony Stark (R.I.P.)


Sun Mar 22, 2009 11:51 am
Profile ICQ YIM
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post Re: RANDOM AND ARRAY (Final JAM)
d'oh <slaps forehead> :D

Figured I was not in the right area.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Sun Mar 22, 2009 1:06 pm
Profile
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: RANDOM AND ARRAY (Final JAM)
One thing to consider is if you are editing a game with 5,000 sectors max instead of 20,000. The length of the autocomplete will probably change. Three numbers entered on a 5k would be ok with a "*", but the 1,000 to 5,000 would probably hose up.

I think in T-edit you can easily get the max sectors and use either a length based work around (length - 1, add *) or a value based. I used length based because I didn't want to test for values.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Sun Mar 22, 2009 1:50 pm
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 30 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.