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
help
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  Anyone have a simple... Post :: Post The moron tramps on...  View next topic  
Author Message
Nikon F5
Guest


Offline

PostPosted: Sat Jan 11, 2003 7:04 pm    Post subject: help Reply to topic Reply with quote

i understand basic c++ but i dont understand the format tha mervbot uses. would someone please help me.[/code]
Back to top
SuSE
Me measures good


Joined: Dec 02 2002
Posts: 2307
Offline

PostPosted: Sat Jan 11, 2003 9:27 pm    Post subject: Reply to topic Reply with quote

-> Tutorial for making plugins for MERVBot and check out catid.sscentral.com and like email catid if you need more.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Nikon F5
Guest


Offline

PostPosted: Sat Jan 11, 2003 9:37 pm    Post subject: Reply to topic Reply with quote

i already have that... i know a little c++ and i tried to explore a source file. all that does is tell you how to compile it which i know.
Back to top
Helicon
Server Help Squatter


Joined: Dec 03 2002
Posts: 771
Location: GNU Doldrums
Offline

PostPosted: Sat Jan 11, 2003 10:45 pm    Post subject: Reply to topic Reply with quote

youre going to have to look at, understand, interpret, and utilize his code. he works that way...
_________________
Signatures just seem so quaint.
Back to top
View users profile Send private message Add User to Ignore List
Nikon F5
Guest


Offline

PostPosted: Sat Jan 11, 2003 11:15 pm    Post subject: Reply to topic Reply with quote

hmm... ive already tried that and it doesnt make any sense but whatever...
Back to top
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Sun Jan 12, 2003 5:13 am    Post subject: Reply to topic Reply with quote

MERVBot uses the normal C++ format(As if you can use any other...) sa_tongue.gif
I dunno... I found it totally understantable at start... just put whatever you want to do in the event switch in botInfo::gotEvent()
_________________
3y3 4m l33t h4x0r
j0! 3y3 4m t4lking to j00!
fux0red 5cr1pt k1dd13.
-"l33t h41ku"
Back to top
View users profile Send private message Add User to Ignore List Send email
Helicon
Server Help Squatter


Joined: Dec 03 2002
Posts: 771
Location: GNU Doldrums
Offline

PostPosted: Sun Jan 12, 2003 3:18 pm    Post subject: Reply to topic Reply with quote

there is a pretty thick line between knowing C++ just to get stuff done, and "knowing" C++ to do development. i personally am not yet too familiar with the second part, but im getting there. its not easy. it takes a lot of experience and playing around (at least it has for me) to get it right. this isnt the high school computer lab... catid isnt your friendly neighbourhood CS teacher.
Back to top
View users profile Send private message Add User to Ignore List
Nikon F5
Guest


Offline

PostPosted: Sun Jan 12, 2003 5:53 pm    Post subject: Reply to topic Reply with quote

ok... thanks
Back to top
Helicon
Server Help Squatter


Joined: Dec 03 2002
Posts: 771
Location: GNU Doldrums
Offline

PostPosted: Sun Jan 12, 2003 7:44 pm    Post subject: Reply to topic Reply with quote

no insult meant, but this is stuff that takes some previous knowledge. if you keep working with getting something done for yourself in SS, eventually just dabbling in the catid's stuff will teach you quite a lot. make it a point to learn what you need to know to write that bot plugin, and by the time you get it done, youll find you know quite a lot more about the language itself, and youll be that much better off for it. icon_eek.gif and youll have learned the semi-fun way, without having to tear through a massive C++ book. at this point you dont know all of C++ by any stretch of the imagination, but youll probably have enough in your belt to learn what you may need to learn fast.

hope this helps... icon_wink.gif
Back to top
View users profile Send private message Add User to Ignore List
Nikon F5
Guest


Offline

PostPosted: Sun Jan 12, 2003 7:54 pm    Post subject: Reply to topic Reply with quote

i understand a little now. say i want to open doors with the command
!doors 0. is this what it would look like. i seriously doubt it but.

Code: Show/Hide
if(c->check("doors 0))
{
sendpublic(p, "?set door:doormode=0");
}
//i dont know if thats the right command to do a public message


i know all of that is in the command file
Back to top
Helicon
Server Help Squatter


Joined: Dec 03 2002
Posts: 771
Location: GNU Doldrums
Offline

PostPosted: Sun Jan 12, 2003 7:59 pm    Post subject: Reply to topic Reply with quote

where did you put that?
Back to top
View users profile Send private message Add User to Ignore List
Nikon F5
Guest


Offline

PostPosted: Sun Jan 12, 2003 9:41 pm    Post subject: Reply to topic Reply with quote

i didnt put that anywhere. i was just wondering if that would be the right code.
Back to top
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Sun Jan 12, 2003 11:40 pm    Post subject: Reply to topic Reply with quote

no

sendPublic(soundcode, text) is the (a) prototype(soundcode is optional)

and you can only check for one single word with c->check()

So it'd be

Code: Show/Hide
if (c->check("doors"))
{
// Trust the player was right and just set it to whatever the player said with no checking
String s = "?set door:doormode:";
s += c->final;//c->final is the final part of the command
sendPublic(/*No sound code needed*/s.msg);//.msg because we are puritan :) You could get by with just s too probably, but s.msg is clearer and more safe
}
Back to top
View users profile Send private message Add User to Ignore List Send email
Nikon F5
Guest


Offline

PostPosted: Mon Jan 13, 2003 4:18 pm    Post subject: Reply to topic Reply with quote

ok. thanks
Back to top
Nikon F5
Guest


Offline

PostPosted: Thu Jan 16, 2003 6:17 pm    Post subject: Reply to topic Reply with quote

i succesfully made my first bot biggrin.gif . it was just a elize source with the elize stuff deleted and a !doors command and a kill macro (thanks to Dr Brain for his help). i was wondering how you base something on a players rec like for example if you want to eliminate a player at 5 deaths.
Back to top
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Thu Jan 16, 2003 11:57 pm    Post subject: Reply to topic Reply with quote

Guess what EVENT_PlayerDeath is for icon_smile.gif
Look for it and put your code after it. The variables should already be there(unless you deleted too much sa_tongue.gif). k is the killer, just so you remember sa_tongue.gif I'm often wondering if k is the killer or the killed...
Back to top
View users profile Send private message Add User to Ignore List Send email
Nikon F5
Guest


Offline

PostPosted: Fri Jan 17, 2003 4:17 pm    Post subject: Reply to topic Reply with quote

i know where to put it, i just dont know what to put
Back to top
Rifle
Guest


Offline

PostPosted: Sat Jan 18, 2003 5:30 pm    Post subject: Reply to topic Reply with quote

What you`re looking for is something like this :

case EVENT_PlayerDeath:

{
Player *p = (Player*)event.p[0], // the player who died
*k = (Player*)event.p[1]; // the killer
Uint16 bounty = (Uint16)event.p[2]; // one of the players bounty

if (p->score.losses==5)
{
sendPrivate(p,"*spec");
sendPrivate(p,"*spec"); //Avoid the player being locked in spec
String s;
s += p->name;
s += "is out!";
sendPublic(s);
}

}

I`m writing most of this from memory, so don`t excpect it to work right away =)

-Rifleman
Back to top
Nikon F5
Newbie


Gender:Gender:Male
Joined: Jan 17 2003
Posts: 20
Offline

PostPosted: Sat Jan 18, 2003 6:30 pm    Post subject: Reply to topic Reply with quote

do you know how to say how many wins:losses?
Back to top
View users profile Send private message Add User to Ignore List
Nikon F5
Newbie


Gender:Gender:Male
Joined: Jan 17 2003
Posts: 20
Offline

PostPosted: Sat Jan 18, 2003 9:51 pm    Post subject: Reply to topic Reply with quote

im working on a bot to host duels. so far, it specs people at 5 deaths. i want to be able to have a customizeable amount of deaths. when i compile i get the error "c:\program files\continuum\mervbot34\mervbot\src\duel\command.cpp(228) : error C2440: '=' : cannot convert from 'char *' to 'int'"

Code: Show/Hide
      if(c->check("enable"))
   {
      onoff=c->final;
   }
Back to top
View users profile Send private message Add User to Ignore List
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Sun Jan 19, 2003 5:02 am    Post subject: Reply to topic Reply with quote

Well obviously onoff is an int, not a string... use some conversion there.
Back to top
View users profile Send private message Add User to Ignore List Send email
Nikon F5
Newbie


Gender:Gender:Male
Joined: Jan 17 2003
Posts: 20
Offline

PostPosted: Sun Jan 19, 2003 8:12 am    Post subject: Reply to topic Reply with quote

i dont know what conversion to use icon_confused.gif
Back to top
View users profile Send private message Add User to Ignore List
SOS
Server Help Squatter


Joined: Dec 02 2002
Posts: 329
Offline

PostPosted: Sun Jan 19, 2003 10:23 am    Post subject: Reply to topic Reply with quote

strtol()
strtoul()
String::toInteger() or something like that

All good
Back to top
View users profile Send private message Add User to Ignore List Send email
Rifle
Guest


Offline

PostPosted: Sun Jan 19, 2003 4:47 pm    Post subject: Reply to topic Reply with quote

I recommend you declare onoff as bool, then use this :

if(c->check("enable"))
{
if (onoff==false)
{
onoff=true;
}
else
{
onoff=false,;
}
}

I find it more understandable this way =)

To display wins/losses, use :

String s;
s += "The player ";
s += p->name;
s += " has ";
s += p->score.wins;
s += " wins and ";
s += p->score.losses;
s += " losses.";
sendPublic(s);

Not that hard to get the hang of once you`ve used it a bit =)

-Rifle
Back to top
Nikon F5
Newbie


Gender:Gender:Male
Joined: Jan 17 2003
Posts: 20
Offline

PostPosted: Sun Jan 19, 2003 5:26 pm    Post subject: Reply to topic Reply with quote

i already figured out my self how to display wins:losses but what i want is like for !enable 5 to spec at 5 and !enable 7 to spec at 7. i know i would have to take the final part of the code and make it the integer but i dont know how.

like sos said above, i need to use a conversion, but i dont know what conversion to use. i tried all the ones sos said and none of them worked.
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: 668 page(s) served in previous 5 minutes.

phpBB Created this page in 0.751644 seconds : 50 queries executed (78.8%): GZIP compression disabled