Author |
Message |
Quan Chi2 Member of "Sexy Teenagers that Code" Group

Age:34 Gender: Joined: Mar 25 2005 Posts: 860 Location: NYC Offline
|
Posted: Sat Aug 06, 2005 8:36 pm Post subject: Am I doing this right? My first plugin |
 |
|
|
|
Im making a plugin of my own. Its nothing too great. Just records staff data, staff updates and stuff.
if (c->check("sysop"))
sendPublic("*getfile sysop.txt");
ifstream file("sysop.txt");
char line[256];
while (file.getline(line, 256))
{
if (CMPSTART("MAXBOXES=", line))
{
MAXBOXES = atoi(&(line[9]));
break;
}
}
file.close();
}
if (c->check("mods"))
sendPublic("*getfile moderator.txt");
ifstream file("moderator.txt");
char line[256];
while (file.getline(line, 256))
{
if (CMPSTART("MAXBOXES=", line))
{
MAXBOXES = atoi(&(line[9]));
break;
}
}
file.close();
}
if (c->("smods"))
sendPublic("*getfile smod.txt");
ifstream file("smod.txt");
char line[256];
while (file.getline(line 256))
{
if (CMPSTART("MATCHBOXES=", line))
MAXBOXES = atoi(&(line[9]));
break;
}
}
file.close();
}
if (c->check("news"))
sendPublic("?getnews");
}
}
if (c->check("time"))
char u[100];
time_t t=time(NULL);
tm *tmp = localtime(&t);
strftime(u,99,"%c",tmp);
sendPublic("Current date and time: " + u);
}
}
|
I also made a part that tells the times.. I figured it would be cool. I got it from that wiki site.
lol I wasn't sure of the command for getting the news text. Just correct me if Im wrong please...
Im also now sure how to seperate commands. please help.
Thanx guys! |
|
Back to top |
|
 |
Underlord Novice
Gender: Joined: Feb 17 2004 Posts: 55 Offline
|
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Sat Aug 06, 2005 10:42 pm Post subject: |
 |
|
|
|
actually, files are uploaded/downloaded to /get/.
LVL files are downloaded to /lvl/. _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
 |
Quan Chi2 Member of "Sexy Teenagers that Code" Group

Age:34 Gender: Joined: Mar 25 2005 Posts: 860 Location: NYC Offline
|
Posted: Sat Aug 06, 2005 10:45 pm Post subject: |
 |
|
|
|
i didnt copy paste... purge helped me.. |
|
Back to top |
|
 |
Purge Episode I > Eposide III Jar-Jar is kool

Age:35 Gender: Joined: Sep 08 2004 Posts: 2019 Offline
|
Posted: Sat Aug 06, 2005 10:46 pm Post subject: |
 |
|
|
|
Not really. I just linked you to the MGB Wiki on that. |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Sun Aug 07, 2005 12:50 am Post subject: |
 |
|
|
|
Ok, give up now if you don't wish to put in the work to learn the language. That is a pathetic attempt at C++.
Along with all the errors Underlord found,
8) You have not checked if the file was even actually opened by the open() member function (sometimes it fails).
9) Commands are usually seperated by if(...){}else if(...){} statements.
10) char u[100]; sendPublic("Current date and time: " + u); is the fucking stupidest thing I've ever seen. Here is the function prototype, someone who actually understands C will know exactly why you are a retard.
void sendPublic(char *msg);
I suggest you give up now, and preform a post-pregnancy abortion on yourself to save you the trouble of reading anything else I have to say. _________________ Current Terror Alert Level
 |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Sun Aug 07, 2005 4:56 am Post subject: |
 |
|
|
|
what im seeing is some attempt to get ahold of the staff files (sysop.txt, smod.txt, etc) with one command. But for the rest, 50% was 100% right  _________________
|
|
Back to top |
|
 |
Quan Chi2 Member of "Sexy Teenagers that Code" Group

Age:34 Gender: Joined: Mar 25 2005 Posts: 860 Location: NYC Offline
|
Posted: Sun Aug 07, 2005 7:32 pm Post subject: |
 |
|
|
|
AH FUCK YOU!
The nerve of you people. Yea, I don't know C++, but I'll be damned if thats going to stop me |
|
Back to top |
|
 |
Quan Chi2 Member of "Sexy Teenagers that Code" Group

Age:34 Gender: Joined: Mar 25 2005 Posts: 860 Location: NYC Offline
|
Posted: Sun Aug 07, 2005 7:33 pm Post subject: |
 |
|
|
|
I'm going to learn C++ from a book. I just haven't brought the book yet from the store. I thought it would be fun to try and code my own bot. SO FUCK YOU FLAMMERS |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Sun Aug 07, 2005 9:35 pm Post subject: |
 |
|
|
|
Don't start with something that elaborate. Start with a message bot, then a warp bot, maybe lvz bot. |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Sun Aug 07, 2005 9:37 pm Post subject: |
 |
|
|
|
Ok, quan, you are officially crazy. Have a nice day. |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:41 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Mon Aug 08, 2005 2:29 am Post subject: |
 |
|
|
|
Bak wrote: | Don't start with something that elaborate. Start with a message bot, then a warp bot, maybe lvz bot. |
My first real project, beyond editing the Pro League bot and making a recorder bot, was to create my own bot core, from scratch, and figuring out almost all the packets by printing out packet logs and figuring out what each packet did. Only later when I got to some of the checksums/timers did I need assistance from Ekted.
If you have the time and determined, you can learn and create things pretty fast. |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Mon Aug 08, 2005 3:59 am Post subject: |
 |
|
|
|
you did that without knowing c++ / c / what packets are? |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Mon Aug 08, 2005 12:01 pm Post subject: |
 |
|
|
|
I've been editing catid's biller without knowing C++.
I just looked at the other code, and learn from that. _________________ SSE Network Administrator |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:41 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Mon Aug 08, 2005 12:05 pm Post subject: |
 |
|
|
|
Bak wrote: | you did that without knowing c++ / c / what packets are? |
I learned C++ by trial and error. Seriously. I knew perl, Ghost Ship sent me the source code for the Pro League bots, and I randomly tried things that looked right, and saw if it compiled. As for packets, I had an idea how they are and how big-endian systems stored bytes.
Of course, all this comes back when Ekted yells at me for my coding system, which was learned from random other people's styles. |
|
Back to top |
|
 |
|