Author |
Message |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sat Nov 19, 2005 3:01 pm Post subject: TWCore:Letter Coords :] |
 |
|
|
|
Well ya know how you have those silly little X/Y coords. Well umm now you can have letter coords. Here is the code:
String coords;
Player p = m_botAction.getPlayerName(event.getPlayerID());
coords=""+((char)(65+((p.getXLocation() * 5 ) >> 12)))+
(((p.getYLocation() * 5 ) >> 12) + 1);
m_botAction.sendPrivateMessage( p.getPlayerName() + " is at " + coords );
|
Something along the lines of that is how you get letter coords.
Output would be: BDwinsAlt is at K10.
If your using a bounty rabbit game do this.
private String wabbit;
public void rabbit(String name, String message){
Player p = m_botAction.getPlayer(name);
if(oplist.isER(name)){
if( message.equals("on") ){
m_botAction.sendArenaMessage( p.getPlayerName() + " is the new rabbit! Get him/her to become the new rabbit." );
wabbit = p.getPlayerName();
m_botAction.sendUnfilteredPrivateMessage( wabbit, "*prize 5000" );
} else if( message.equals("off") ){
wabbit=off;
}
} if( message.equals("") ){
m_botAction.sendPrivateMessage( name, "Wabbit: " + wabbit );
}
}
public void handleEvent(PlayerDeath event){
String killee = m_botAction.getPlayerName( event.getKilleeID() );
String killer = m_botAction.getPlayerName( event.getKillerID() );
String coords;
Player p = m_botAction.getPlayer(event.getKillerID());
coords=""+((char)(65+((p.getXLocation() * 5 ) >> 12)))+(((p.getYLocation() * 5 ) >> 12) + 1);
if( killee.equals(wabbit) ){
m_botAction.sendUnfilteredPrivateMessage( killer, "*points 100000" );
m_botAction.sendUnfilteredPrivateMessage( killer, "*prize 5000" );
m_botAction.sendArenaMessage( killer + " is the new rabbit! Kill the wabbit to get the reward! (" + coords + ")" );
m_botAction.sendPrivateMessage( wabbit, "You are no longer the wabbit!" );
m_botAction.sendPrivateMessage( killer, "You are the new wabbit! You have been given the reward: 100,000 points." );
wabbit = killer;
}
|
Ta-Dah, now you can point and laugh at me and my code.
Credits: Thanks to wiredfreak (SSCU Redstar) for the coord coding. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat Nov 19, 2005 5:26 pm Post subject: |
 |
|
|
|
*points and laughs* _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sat Nov 19, 2005 7:23 pm Post subject: |
 |
|
|
|
lol it is, weird. Anyways it was in custom code. I posted it there because i didn't think my topic was a question. |
|
Back to top |
|
 |
Chambahs Power attack

Joined: Jun 19 2005 Posts: 820 Offline
|
Posted: Sat Nov 19, 2005 7:25 pm Post subject: |
 |
|
|
|
thsis isnt custoim code. iths is bot questionas |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sat Nov 19, 2005 9:01 pm Post subject: |
 |
|
|
|
Who knows d1s lol. Well i know my way works.
Hmm i wonder if letter coords are included in TWCore 1.0
Im checking the site 58 times a day to see if its released. |
|
Back to top |
|
 |
Cerium Server Help Squatter

Age:42 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Sun Nov 20, 2005 12:29 am Post subject: |
 |
|
|
|
Dont count on it. Something like that requires so little work it doesnt need to be built into the core, and by all means SHOULDNT be. _________________ There are 7 user(s) ignoring me right now. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sun Nov 20, 2005 1:20 am Post subject: |
 |
|
|
|
Its more convenient to have a p.getLetterCoords() rather than having to make the code . |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Sun Nov 20, 2005 2:41 am Post subject: |
 |
|
|
|
*points and laughs* _________________ 4,691 irradiated haggis! |
|
Back to top |
|
 |
Cerium Server Help Squatter

Age:42 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Sun Nov 20, 2005 7:23 pm Post subject: |
 |
|
|
|
public class BloatedPlayer extends Player
{
public String getLetterCoords()
{
...
}
} |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sun Nov 20, 2005 8:19 pm Post subject: |
 |
|
|
|
It would actually make a lot more sense to make it static in a utility class such as Tools. Even having it in BotAction would make more sense than putting it in Player. |
|
Back to top |
|
 |
Cerium Server Help Squatter

Age:42 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Sun Nov 20, 2005 10:04 pm Post subject: |
 |
|
|
|
I wouldnt bother. The number of bots which actually make use of it isnt nearly high enough to add a block of code that simple into the core. |
|
Back to top |
|
 |
cypher@lazy Guest
Offline
|
Posted: Mon Nov 21, 2005 11:35 am Post subject: |
 |
|
|
|
I must join in here, it's too small of a code block to be required in the core; however, if they were to do it, I'd suggest making it a static function like they do w/ the Java Math util functions (since it's not dependent on anything spectacular). I doubt the map size will change any time soon, etc. etc. |
|
Back to top |
|
 |
|