Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
TWCore:Letter Coords :]

 
Post new topic   Reply to topic Printable version
 View previous topic  TWCore Setup Post :: Post Bot request  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Nov 19, 2005 3:01 pm    Post subject: TWCore:Letter Coords :] Reply to topic Reply with quote

Well ya know how you have those silly little X/Y coords. Well umm now you can have letter coords. Here is the code:
Code: Show/Hide

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.

Code: Show/Hide

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sat Nov 19, 2005 5:26 pm    Post subject: Reply to topic Reply with quote

*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
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Nov 19, 2005 7:23 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Chambahs
Power attack
Power attack


Joined: Jun 19 2005
Posts: 820
Offline

PostPosted: Sat Nov 19, 2005 7:25 pm    Post subject: Reply to topic Reply with quote

thsis isnt custoim code. iths is bot questionas
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sat Nov 19, 2005 8:36 pm    Post subject: Reply to topic Reply with quote

wouldn't something like this be a lot easier?

Note: didn't compile this so theres probably an error somewhere

Code: Show/Hide
public String getPlayerLocation(int xtiles, int ytiles)
{
   char x = ('A' + xtiles * 20 / 1024);
   short y = (ytiles * 20 / 1024) + 1;
   return (""+ x + y);
}

_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat Nov 19, 2005 9:01 pm    Post subject: Reply to topic Reply with quote

Who knows d1s lol. Well i know my way works. sa_tongue.gif

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Cerium
Server Help Squatter


Age:41
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Sun Nov 20, 2005 12:29 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sun Nov 20, 2005 1:20 am    Post subject: Reply to topic Reply with quote

Its more convenient to have a p.getLetterCoords() rather than having to make the code sa_tongue.gif .
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sun Nov 20, 2005 2:41 am    Post subject: Reply to topic Reply with quote

*points and laughs*
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Cerium
Server Help Squatter


Age:41
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Sun Nov 20, 2005 7:23 pm    Post subject: Reply to topic Reply with quote

public class BloatedPlayer extends Player
{
public String getLetterCoords()
{
...
}
}
Back to top
View users profile Send private message Add User to Ignore List AIM Address
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sun Nov 20, 2005 8:19 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
Cerium
Server Help Squatter


Age:41
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Sun Nov 20, 2005 10:04 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address
cypher@lazy
Guest


Offline

PostPosted: Mon Nov 21, 2005 11:35 am    Post subject: Reply to topic Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 717 page(s) served in previous 5 minutes.

phpBB Created this page in 1.515597 seconds : 37 queries executed (27.5%): GZIP compression disabled