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
Mervbot c->final

 
Post new topic   Reply to topic Printable version
 View previous topic  Voting tutorial... Post :: Post Comparing dates?  View next topic  
Author Message
Maverick
broken record


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

PostPosted: Sat Feb 26, 2005 2:01 pm    Post subject: Mervbot c->final Reply to topic Reply with quote

Hiya Guys,

Got a simple question concering Mervbot:

When a player does '!command parameter'; How can I get the full command and parameter in a String?
I am trying to do that now because I have a command that concerns giving a squad for a parameter. So if the operator does !command -=SMG=- Mervbot sees that as a switch and then c->final is empty icon_confused.gif

Someone already had this problem or does someone know the solution to this?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


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

PostPosted: Sat Feb 26, 2005 2:16 pm    Post subject: Reply to topic Reply with quote

Code: Show/Hide
struct Command
{
   _linkedlist <_switch> slist;

   char *cmd;      // !_______ -at=blah-s blah
   char *final;   // !command -at=blah-s ____

   Command(char *msg);            // Parse
   ~Command();                  // Clean up

   bool check(char *msg);         // Check against cmd
   bool checkParam(char *msg);      // Check against final

   void addParam(char *msg);      // Add a switch
   _switch *getParam(char type);   // Check against switches
};


It doesn't appear to have something like that built in...
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
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: Sat Feb 26, 2005 2:27 pm    Post subject: Reply to topic Reply with quote

It "thinks" that "-=SMG=-" is a switch?
Hah, sounds like a command parsing "bug" to me.

A nasty, quick solution may be adding an extra characters to it, like quotes next to the squadname.

Otherwise you could edit the core and add some variable which contains the whole line after the command or get rid of switches.
Back to top
View users profile Send private message Add User to Ignore List
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: Sat Feb 26, 2005 2:47 pm    Post subject: Reply to topic Reply with quote

Just don't design command stuff starting with the '-' character. I can't see any situation in which it would be necessary.
_________________
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
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: Sat Feb 26, 2005 3:08 pm    Post subject: Reply to topic Reply with quote

He wants a parameter to be able to start with '-', since the parameter of his command is supposed to have a squadname as the parameter.
So, if a squadname starts with a '-' he's screwed since MERV parses it as a switch.
Back to top
View users profile Send private message Add User to Ignore List
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: Sun Feb 27, 2005 12:36 am    Post subject: Reply to topic Reply with quote

Oh, duh. Sorry, I guess I didn't read too clearly.

You could just have them put the squad name in quotes. It's kinda hard to make a very reliable command system to recognize what's a switch and what's raw input, and Catid's command processing code kinda sucks. Maybe I'll rewrite it some day for him. Some day.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Sun Feb 27, 2005 4:00 am    Post subject: Reply to topic Reply with quote

Mervbot core should handle all command functions, similar to the way ASSS does. Have the dll register commands with the core and have the core store a pointer to a specific function in the dll that should be run when the command is sent to the bot. Registering !commands with the core will allow for the core to display a nicely formated !help menu. You can take a look at a powerbot in EG or PB, they register commands with the core and it makes it easier to read commands and understand them.

Switches are useless, they should be taken out entirely or made into a seperate function.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Maverick
broken record


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

PostPosted: Sun Feb 27, 2005 4:41 am    Post subject: Reply to topic Reply with quote

hmm ok.. quotes it is then.

I suppose it also isn't possible to somehow use the switch to get the full parameter anyway?

(first I thought that Mervbot was wow and way to go icon_surprised.gif but that feeling is getting lesser and lesser while making advanced bots icon_sad.gif )
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
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: Sun Feb 27, 2005 5:41 am    Post subject: Reply to topic Reply with quote

Maverick wrote:
I suppose it also isn't possible to somehow use the switch to get the full parameter anyway?


It probably is.
On the league bot, in the zone I was staff in, we used -a= -b= switches to set the squadnames.
In a log I just saw that a player set the squadnames to "-a" and "-b", which means that the actual switch parameters can start with a '-'.

So, in your case "!command -p=-=SMG=-" might work, if not, use the quotes or hack the core. sa_tongue.gif
Back to top
View users profile Send private message Add User to Ignore List
Maverick
broken record


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

PostPosted: Sun Feb 27, 2005 6:35 am    Post subject: Reply to topic Reply with quote

ok grav_cool-hands.gif

icon_wink.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


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

PostPosted: Sun Feb 27, 2005 9:30 am    Post subject: Reply to topic Reply with quote

From what I've seen, the bots all have most things in common and just differ in what "fancy things" they have (thanks 50% biggrin.gif). Probably the biggest difference between the 3 main cores is the language they are written in. I'd be writing stuff in asss, but I can't get stupid grub to work icon_sad.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
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: 113 page(s) served in previous 5 minutes.

phpBB Created this page in 0.519715 seconds : 35 queries executed (88.2%): GZIP compression disabled