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
Yet another newbie question of mine...
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  get local file Post :: Post Stupid bot  View next topic  
Author Message
Quan Chi2
Member of "Sexy Teenagers that Code" Group
Member of


Age:34
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 860
Location: NYC
Offline

PostPosted: Wed Sep 07, 2005 3:37 pm    Post subject: Yet another newbie question of mine... Reply to topic Reply with quote

Can someone tell me how.. or point me in the right direction for this one?

I want to code a few different bots this way..
How do I make my dll turn off/on game mode and actions?

like

Im going to make this bot that gives people a super ship when they enter.. lol just if i get bored one day..

i want to make it so that when i do

.supers on (it turns this mode on, and everyone gets super when they come in)

and

.supers off (no one gets super anymore.. i know that they will still have super, but i'll figure out a way to stop that..)

I pretty much want to make this bot to learn how to turn off and on game modes.. for different games..

Can anyone HELP me on this one? Even a small 3 word tip would be a help.. Im not looking for a full src(a code would be nice of course, but its not needed lol).. I just need some direction...

Thanks in advance..
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
freakmonger
Novice


Joined: Jan 07 2005
Posts: 45
Location: Arlington, VA
Offline

PostPosted: Wed Sep 07, 2005 3:47 pm    Post subject: Reply to topic Reply with quote

..

Last edited by freakmonger on Wed Sep 07, 2005 4:22 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Send email
Cyan~Fire
I'll count you!
I'll count you!


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

PostPosted: Wed Sep 07, 2005 3:48 pm    Post subject: Reply to topic Reply with quote

Make a bunch of setting changes at once using EVENT_ChangeSettings.
_________________
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
Maverick
broken record


Age:40
Gender:Gender:Male
Joined: Feb 26 2005
Posts: 1521
Location: The Netherlands
Offline

PostPosted: Wed Sep 07, 2005 4:29 pm    Post subject: Reply to topic Reply with quote

No its more fun to PM everyone *super.... aaand much easier too ! icon_twisted.gif
_________________
Nickname: Maverick (I changed my name!)
TWCore developer | Subspace statistics
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:35
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2019
Offline

PostPosted: Wed Sep 07, 2005 5:21 pm    Post subject: Reply to topic Reply with quote

Maverick wrote:
No its more fun to PM everyone *super.... aaand much easier too ! icon_twisted.gif


They'd have to be sysop or they'll get kicked.
Back to top
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


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

PostPosted: Wed Sep 07, 2005 5:37 pm    Post subject: Re: Yet another newbie question of mine... Reply to topic Reply with quote

Quote:
Can anyone HELP me on this one? Even a small 3 word tip would be a help..


Get A Life.
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
Maverick
broken record


Age:40
Gender:Gender:Male
Joined: Feb 26 2005
Posts: 1521
Location: The Netherlands
Offline

PostPosted: Wed Sep 07, 2005 6:01 pm    Post subject: Reply to topic Reply with quote

Purge+ wrote:
... or they'll get kicked.

hence the evil grin icon_twisted.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Quan Chi2
Member of "Sexy Teenagers that Code" Group
Member of


Age:34
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 860
Location: NYC
Offline

PostPosted: Wed Sep 07, 2005 8:58 pm    Post subject: Reply to topic Reply with quote

But I want to turn it on and off.. lol
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
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Wed Sep 07, 2005 8:58 pm    Post subject: Reply to topic Reply with quote

use a boolean variable to keep track if the game is on or not, and then prize based on the value of that variable
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Quan Chi2
Member of "Sexy Teenagers that Code" Group
Member of


Age:34
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 860
Location: NYC
Offline

PostPosted: Wed Sep 07, 2005 9:25 pm    Post subject: Reply to topic Reply with quote

wtf?
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
Guest



Offline

PostPosted: Fri Sep 09, 2005 8:13 am    Post subject: Reply to topic Reply with quote

as bak said you need a boolean which will be toggled TRUE/FALSE when the bot receives a .supers on/off message

then when a player enters the arena you check if the boolean is true, and if it is you prize them super
Back to top
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Sep 09, 2005 10:12 am    Post subject: Reply to topic Reply with quote

You do need code, obviously. icon_neutral.gif

Well, first what you didn't understand.

Bak wrote:
use a boolean variable to keep track if the game is on or not, and then prize based on the value of that variable

A boolean variable would be a variable (a piece of data of a certain type) which can be set to true or false.
Think of it as a switch.

First make this variable in the botInfo class (spawn.h):

Code: Show/Hide
class botInfo
{
   // Skipping a few lines to improve readability...
   bool give_supers; // <-- Add the variable to this class! Do NOT make another botInfo class.
public:
   botInfo(CALL_HANDLE given)
   {


Now you can use this "switch" to turn things on and off.
It doesn't do much yet though, we have to make something to turn the switch on or off.
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Sep 09, 2005 10:14 am    Post subject: Reply to topic Reply with quote

Do you want our switch to be on or off by default?

I'm not sure if you have to set it to false with your compiler, let's just enable it by default:

In the same class (under "botInfo(CALL_HANDLE given)", which is what we call the "constructor" of the class) you add a line like:

Code: Show/Hide
class botInfo
{
   // Skipping a few lines to improve readability...
   bool give_supers;
public:
   botInfo(CALL_HANDLE given)
   {
      give_supers = true; // <-- This will enable our feature by default.
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Sep 09, 2005 10:14 am    Post subject: Reply to topic Reply with quote

Now we can implement a command to turn give_supers on or off, in command.cpp (make sure to put this command in the right operator code block!).

Code: Show/Hide
         if (c->check("supers"))
         {
            if (c->checkParam("on"))
            {
               if (give_supers)
                  sendPrivate(p, "Prizing super was enabled already.");
               else
               {
                  give_supers = true;
                  sendPrivate(p, "Prizing super is now enabled.");   
               }
            }
            else if (c->checkParam("off"))
            {
               if (give_supers)
               {
                  give_supers = false;
                  sendPrivate(p, "Prizing super is now disabled.");
               }
               else
                  sendPrivate(p, "Prizing super was disabled already.");
            }
            else
            {
               // No parameter for the supers command was used, we could make the plugin
               // give the current status of the prizing.
   
               String s = "Prizing super is currently ";
               
               if (give_supers)
                  s += "enabled.";
               else
                  s += "disabled.";
               
               sendPrivate(p, s);
   
               // You could, of course, show the command syntax help.
               //sendPrivate(, "Please specify a parameter for the !supers command: !supers [on|off].");
            }
         }
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Sep 09, 2005 10:15 am    Post subject: Reply to topic Reply with quote

Or maybe you'd prefer something like this (with a seperate status command parameter):

Code: Show/Hide
            if (c->check("supers"))
            {
               if (c->checkParam("on"))
               {
                  if (give_supers)
                     sendPrivate(p, "Prizing super was enabled already.");
                  else
                  {
                     give_supers = true;
                     sendPrivate(p, "Prizing super is now enabled..");   
                  }
               }
               else if (c->checkParam("off"))
               {
                  if (give_supers)
                  {
                     give_supers = false;
                     sendPrivate(p, "Prizing super is now disabled.");
                  }
                  else
                     sendPrivate(p, "Prizing super was disabled already.");
               }
               else if (c->checkParam("status"))
               {
                  // Show status of super prizing.
                  String s = "Prizing super is currently ";

                  if (give_supers)
                     s += "enabled.";
                  else
                     s += "disabled.";

                  sendPrivate(p, s);
               }
               else
               {
                  sendPrivate(p, "Please specify a parameter for the !supers command: !supers [on|off|status].");
               }
            }


Last edited by Solo Ace on Fri Sep 09, 2005 10:16 am, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Sep 09, 2005 10:16 am    Post subject: Reply to topic Reply with quote

Now we have to make sure the bot will actually prize super to players if give_supers is set to true.

Which is done like this (in spawn.cpp):

Code: Show/Hide
   case EVENT_PlayerShip:
      {
         Player *p = (Player*)event.p[0];
         Uint16 oldship = (Uint16)(Uint32)event.p[1];
         Uint16 oldteam = (Uint16)(Uint32)event.p[2];
         
         // Are we giving super? If so, send a *prize #17 (super).
         if (give_supers)
            sendPrivate(p, "*prize #17");
      }
      break;
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Sep 09, 2005 10:26 am    Post subject: Reply to topic Reply with quote

If you'd want to want to remove everyone's super, you'd just do this at the part where super was disabled.

Code: Show/Hide
   // Iterate through the playerlist and remove everyone's super (*prize #-17).
   
   _listnode <Player> *parse = playerlist->head;

   while (parse)
   {
      Player *p = parse->item;
      
      if (p->ship != SHIP_Spectator)
         sendPrivate(p, "*prize #-17");

      parse = parse->next;
   }


This will send *prize #-17 to everyone who's currently in the arena (in a ship).

Maybe checking if a player is really in a ship (not spectator) is required when prizing super too.
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Sep 09, 2005 10:50 am    Post subject: Reply to topic Reply with quote

6 posts in a row. Some kind of a record?
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Fri Sep 09, 2005 11:36 am    Post subject: Reply to topic Reply with quote

Dr Brain wrote:
6 posts in a row. Some kind of a record?

Actually, I like the way he laid it out. Making them into new posts divides the topics he covers in each post very well.
Back to top
View users profile Send private message Add User to Ignore List Send email
D1st0rt
Miss Directed Wannabe


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

PostPosted: Fri Sep 09, 2005 12:48 pm    Post subject: Reply to topic Reply with quote

I think it's still a record, even though its done in good taste.
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Chambahs
Power attack
Power attack


Joined: Jun 19 2005
Posts: 820
Offline

PostPosted: Fri Sep 09, 2005 1:59 pm    Post subject: Reply to topic Reply with quote

solo, why dont you just write the whole damn thing for him?
Back to top
View users profile Send private message Add User to Ignore List
LearJett+
Server Help Squatter


Joined: Jul 11 2005
Posts: 281
Offline

PostPosted: Fri Sep 09, 2005 2:24 pm    Post subject: Reply to topic Reply with quote

Wow, people are very helpful on here icon_eek.gif
_________________
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Sep 09, 2005 2:37 pm    Post subject: Reply to topic Reply with quote

He wants to learn, obviously. You don't learn much by getting completed work in your hands.

Also, I had it split up because multiple code boxes were messing my posts up.

The record would be MGB's "The Leper's Colony", and well, maybe there are other threads where some spammer has created more posts in one row.

Why are you all whining about what I just wrote? You are acting like a bunch of sheep. It's not the point how many posts I took for it.
You don't buy a very expensive TV and then put a bag on it. You don't buy a very expensive horse and then say "bah, stupid horse" as soon as you get it. sa_tongue.gif
You don't read a decent article and then whine because it took a few pages.
You wouldn't whine about the way my decent guide was posted if you would respect the effort that was put into it.
Spoiled brats, always having something to complain.
Some people on this planet don't have much more than shoes and the ground they stand on, and you complain about 6 posts?

Sorry, I'll get back to normal mode. sa_tongue.gif
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Sep 09, 2005 2:39 pm    Post subject: Reply to topic Reply with quote

Solo Ace wrote:
Also, I had it split up because multiple code boxes were messing my posts up.


Ah. That explains it.

Also I was not complaining. Just commenting.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Sep 09, 2005 2:43 pm    Post subject: Reply to topic Reply with quote

I was kidding, you know that.
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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: 124 page(s) served in previous 5 minutes.

phpBB Created this page in 0.567924 seconds : 49 queries executed (86.4%): GZIP compression disabled