Talk:MERVBot Tutorial
D1s: Anybody wanna format this int a table of contents? I'm lazy
Smong: That is sick. Maybe split into more pages? Says it is over 160k.
Pests: There is already pages defined. You could just split them up into that.
OK, I'm working on converting it to real HTML (using <pre>) instead of the crap. --Cyan~Fire
CypherJF: Should we just call this "the bot tutorial" based on the tutorial by Underlord? Then update it accordingly? -- And also, the link to MervBot w/e 37 is now 45; should we just comment that this tutorial was writen for the 37 -- or... comments! lol.
CypherJF: I'd like to say that all sections appear to have been updated for the Wiki; time to go through edit, and catch mistakes. Add to the wiki itself - perhaps more example code.
sscanf
Well, I'm using sscanf() for parsing player input. Yes, an advanced function, but maybe it will discourage C++ newbs from making bot plugins. Any comments? --Cyan~Fire
D1st0rt: Cool beans. I learned something new :D
Event list
Removed event list because it was redundant with dllcore.h, less descriptive, and too easy to get out-of-date. Anybody who wants it back, please post here so I can ignore you. :-D --Cyan~Fire
CypherJF: Like people are really going to read through the dllcore.h file.. on a webpage tutorial. hmm i think not. I still say keep it there.
If someone doesn't make the effort to look up events in dllcore.h, they shouldn't be making plugins. I think of this tutorial as more of a "here are the basics and intricacies of making a MERVBot plugin" more than "here is how to follow step-by-step instructions and call it programming". --Cyan~Fire
D1s: Even I look up things in dllcore.h, its a very useful resource. As long as it says to look in it, I don't think we'd need the full list here
Extra Code Samples
CypherJF: I'd like to somehow split these up better; and make them linkable, what do you guy's think?
CypherJF: I made sub-headers, and so they'll be added into the table of contents. Let me know what you guys think of it.
Alrighty, looks good. One thing I would ask is to try to save up a bunch of edits in a text editor or something, than have the myriad edits you do now. Thanks for sharing the burden with me! --Cyan~Fire
CypherJF: Well I've been doing the edits from all around campus. Like yesterday I did 4-6 things from the MathLab; and the rest from the dorm, etc. lol. I don't think it really matters, since there isn't much other activity going on.. on the wiki.
Oh, OK, that's fine. Also, do remember that the wiki will automatically do your <p>ing for you as long as you leave a blank line in-between "paragraphs". --Cyan~Fire
old toc
Please leave this here for now. --Cyan~Fire
Setup a MERVBot bot and project in visual c++
0) <a href="#0">Setting up a MERVBot bot</a>
Command.cpp
1) <a href="#1">Player commands</a> (!play, !squadA vs squadB)
Spawn.cpp
2) <a href="#2">Event descriptions</a> (describe events in spawn.cpp)
2) <a href="#2">Messaging </a>("*arena hi", ":player:*scorereset)
3) <a href="#3">MervBot Timer</a> (do this in 10 seconds)(countdown[n])
4) <a href="#4">Writing Functions</a> (bool IsInCenter(Player *p))
Useful operations
6) <a href="#6">Cycling players</a>
7) <a href="#7">Check if pilot is in safe zone</a>
8) <a href="#8">Random numbers</a>
9) <a href="#9">Time without using countdown[n]</a>
10) <a href="#10">Storing data for pilots</a>
11) <a href="#11">Output data in messages</a>
12) <a href="#12">Input/Output to files</a>
13) <a href="#13">Programming commands</a>
14) <a href="#14">Useful player data</a>
15) <a href="#15">Bot built in functions</a>
Example Code
a) <a href="#15a">No antiwarp in center of map</a>
b) <a href="#15b">Setting freq size depending on how many pilots in game</a>
c) <a href="#15c">Tracking kills and announcing when pilot gets 10 kills in a row without dying </a>
d) <a href="#15d">Warp pilot to coord when they are in a certain region</a>
e) <a href="#15e">Structures within structures</a>
f) <a href="#15f">Tracking flag data</a>
g) <a href="#15g">Way to do simple /!spam feature</a>
h) <a href="#15h">Implementing a simple stack to do "next in line for several 'boxes' at once"</a>
i) <a href="#15i">Reading any text from a .txt and printing it to pilot line by line</a>
j) <a href="#15j">Example of printing player stats grid</a>
k) <a href="#15k">Example of checking if any pilots are within a region</a>
l) <a href="#15l">Example of functions to get a pilot's struct id info from a name or *player info</a>
m) <a href="#15m">Example of creating a logfile name using date and squad names</a>
n) <a href="#15n">Sending messages to playing freqs or public and logging depending on status</a>
o) <a href="#15o">Example of reading in all player/freqs to struct data</a>
p) <a href="#15p">Example of finding MVP from struct data</a>
q) <a href="#15q">Print time stamp of event</a>
r) <a href="#15r">Simple way to track player bomb/bullet damage stats</a>
s) <a href="#15s">Simple way to print those stats</a>
t) <a href="#15t">Make bot spectate specific coordinates</a>