where'd that inactive TWEL forum go? :[
Announcement
Collapse
No announcement yet.
2dragons
Collapse
X
-
ok, here we go again, this time we'll play string concatenation instead of int adding
first, we start w/ a blank string... ""
then add 1 for wb, 2 for jav, or 3 for spider.
then we add the row number (row 4 = 04, row 2 = 02 row 14 = 14)
then we add the position on the row (there are 4 spaces on each row (2 before the -, 2 after it) numbered 0, 1, 2, 3 according
then we add the number we want to place there 0-9
so if we wanted to set row 5 of javs to the score 05-08 we'd do:
20510
20525
20530
20538
for objonsBan Ikrit
Comment
-
Code:String boxToRow[] = {"","01","01","02","03","02","04","03","05","04","06","05","07","08","06","09","07","10","08","11","09","12","13","14","10"} public void redoBox(int gameType, int box, int score1, int score2) { String row = boxToRow[box]; oldOff(gameType, row, 0, score1); oldOff(gameType, row, 2, score2); newOn(gameType, row, 0, score1); newOn(gameType, row, 2, score2); } public void oldOff(int gameType, String row, int pos, int score) { int tensScore = score / 10; int onesScore = score % 10; if(onesScore != 0) { m_botAction.sendUnfilteredPublicMessage("*objoff " + gameType + row + pos + tensScore); m_botAction.sendUnfilteredPublicMessage("*objoff " + gameType + row + (pos + 1) + (onesScore - 1)); } else { m_botAction.sendUnfilteredPublicMessage("*objoff " + gameType + row + pos + (tensScore - 1)); m_botAction.sendUnfilteredPublicMessage("*objoff " + gameType + row + (pos + 1) + 9); } } public void newOn(int gameType, String row, int pos, int score) { int tensScore = score / 10; int onesScore = score % 10; m_botAction.sendUnfilteredPublicMessage("*objon " + gameType + row + pos + tensScore); m_botAction.sendUnfilteredPublicMessage("*objon " + gameType + row + (pos + 1) + onesScore); }
assuming I did that stuff right (12:30am here... and tired) that'd be the code that you could use to turn the redo the objons for the thing whenever a score changes. You'd just have to call redoBox method using the parameters:
gameType - 1,2, or 3... wb, jav, spid respectively
box- box number they are in
score1- score of the first player
score2- score of the second player
and it'd do the restLast edited by Ikrit; 11-01-2004, 02:34 AM.Ban Ikrit
Comment
-
for good measure I'm throwing this method in too...
Code:public void finalOff(int gameType, int box, int score1, int score2) { int tensScore = score1 / 10; int onesScore = score1 % 10 m_botAction.sendUnfilteredPublicMessage("*objoff " + gameType + boxToRow[box] + 0 + tensScore); m_botAction.sendUnfilteredPublicMessage("*objoff " + gameType + boxToRow[box] + 1 + onesScore); tensScore = score2 / 10; onesScore = score2 % 10 m_botAction.sendUnfilteredPublicMessage("*objoff " + gameType + boxToRow[box] + 2 + tensScore); m_botAction.sendUnfilteredPublicMessage("*objoff " + gameType + boxToRow[box] + 3 + onesScore);
of course... I'm pretty dumb sometimes so you might wanna check the code especially after I wake up after a whole 4 hours of sleep...Ban Ikrit
Comment
-
Jacen Solo has confused me.EvoLd> Roboqueen died again?
cool koen> :)
PRiMORDiAL> pfft
cool koen> not because of a bug
EvoLd> Lol
Treachery> meh
EvoLd> why then?
PubAceR> women in power dont last
EvoLd> LOl
toaster oven reviews
Comment
-
i know this is a old and dead thread but any chance of a update on how the duel bot is doing?Cat: You'd never get a cat to be a servant. You ever see a cat return a stick? 'Hey man. You threw the stick, you go and get it yourself, I'm busy. If you wanted the stick so bad, why'd you throw it away in the first place?'
Comment
-
I just realised you live in Scotland! I laugh at your misfortune.EvoLd> Roboqueen died again?
cool koen> :)
PRiMORDiAL> pfft
cool koen> not because of a bug
EvoLd> Lol
Treachery> meh
EvoLd> why then?
PubAceR> women in power dont last
EvoLd> LOl
toaster oven reviews
Comment
Channels
Collapse
Comment