Author |
Message |
Nikon F5 Guest
Offline
|
Posted: Sat Jan 11, 2003 7:04 pm Post subject: help |
|
|
|
|
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
|
|
Back to top |
|
|
Nikon F5 Guest
Offline
|
Posted: Sat Jan 11, 2003 9:37 pm Post subject: |
|
|
|
|
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
|
Posted: Sat Jan 11, 2003 10:45 pm Post subject: |
|
|
|
|
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 |
|
|
Nikon F5 Guest
Offline
|
Posted: Sat Jan 11, 2003 11:15 pm Post subject: |
|
|
|
|
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
|
Posted: Sun Jan 12, 2003 5:13 am Post subject: |
|
|
|
|
MERVBot uses the normal C++ format(As if you can use any other...)
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 |
|
|
Helicon Server Help Squatter
Joined: Dec 03 2002 Posts: 771 Location: GNU Doldrums Offline
|
Posted: Sun Jan 12, 2003 3:18 pm Post subject: |
|
|
|
|
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 |
|
|
Nikon F5 Guest
Offline
|
Posted: Sun Jan 12, 2003 5:53 pm Post subject: |
|
|
|
|
ok... thanks |
|
Back to top |
|
|
Helicon Server Help Squatter
Joined: Dec 03 2002 Posts: 771 Location: GNU Doldrums Offline
|
Posted: Sun Jan 12, 2003 7:44 pm Post subject: |
|
|
|
|
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. 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... |
|
Back to top |
|
|
Nikon F5 Guest
Offline
|
|
Back to top |
|
|
Helicon Server Help Squatter
Joined: Dec 03 2002 Posts: 771 Location: GNU Doldrums Offline
|
Posted: Sun Jan 12, 2003 7:59 pm Post subject: |
|
|
|
|
where did you put that? |
|
Back to top |
|
|
Nikon F5 Guest
Offline
|
Posted: Sun Jan 12, 2003 9:41 pm Post subject: |
|
|
|
|
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
|
|
Back to top |
|
|
Nikon F5 Guest
Offline
|
Posted: Mon Jan 13, 2003 4:18 pm Post subject: |
|
|
|
|
ok. thanks |
|
Back to top |
|
|
Nikon F5 Guest
Offline
|
Posted: Thu Jan 16, 2003 6:17 pm Post subject: |
|
|
|
|
i succesfully made my first bot . 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
|
Posted: Thu Jan 16, 2003 11:57 pm Post subject: |
|
|
|
|
Guess what EVENT_PlayerDeath is for
Look for it and put your code after it. The variables should already be there(unless you deleted too much ). k is the killer, just so you remember I'm often wondering if k is the killer or the killed... |
|
Back to top |
|
|
Nikon F5 Guest
Offline
|
Posted: Fri Jan 17, 2003 4:17 pm Post subject: |
|
|
|
|
i know where to put it, i just dont know what to put |
|
Back to top |
|
|
Rifle Guest
Offline
|
Posted: Sat Jan 18, 2003 5:30 pm Post subject: |
|
|
|
|
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: Joined: Jan 17 2003 Posts: 20 Offline
|
Posted: Sat Jan 18, 2003 6:30 pm Post subject: |
|
|
|
|
do you know how to say how many wins:losses? |
|
Back to top |
|
|
Nikon F5 Newbie
Gender: Joined: Jan 17 2003 Posts: 20 Offline
|
|
Back to top |
|
|
SOS Server Help Squatter
Joined: Dec 02 2002 Posts: 329 Offline
|
Posted: Sun Jan 19, 2003 5:02 am Post subject: |
|
|
|
|
Well obviously onoff is an int, not a string... use some conversion there. |
|
Back to top |
|
|
Nikon F5 Newbie
Gender: Joined: Jan 17 2003 Posts: 20 Offline
|
Posted: Sun Jan 19, 2003 8:12 am Post subject: |
|
|
|
|
i dont know what conversion to use |
|
Back to top |
|
|
SOS Server Help Squatter
Joined: Dec 02 2002 Posts: 329 Offline
|
Posted: Sun Jan 19, 2003 10:23 am Post subject: |
|
|
|
|
strtol()
strtoul()
String::toInteger() or something like that
All good |
|
Back to top |
|
|
Rifle Guest
Offline
|
Posted: Sun Jan 19, 2003 4:47 pm Post subject: |
|
|
|
|
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: Joined: Jan 17 2003 Posts: 20 Offline
|
Posted: Sun Jan 19, 2003 5:26 pm Post subject: |
|
|
|
|
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 |
|
|
|