Author |
Message |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Sun Nov 23, 2003 2:55 pm Post subject: Recreating the MusicLock bot, but there is a error |
 |
|
|
|
Ive looked over my source and I just cant see the error. It works just fine when its just me and another player, but i tested it in a zone with a huge population and it messes up somewhere. It starts locking freq when anyone picks up a flag. It works fine for a while but then someone does something that messes it up, havent found out what yet. Could be a confict with another plugin on that zone's bot.
Explaination of how it works. Instead of guessing the total number of flags like MusicLock bot, it has a file were somone specifies the number. Every time a person picks up a flag, it calculates the number of flags they own on the flaglist and the total number of flags thier team members are carring. Once they reach the total number of flags, it records thier names. If anyone changes ships/leaves/specs and they have flags, the freq is unlocked becuase of nuet. If a player kill another player with flags, the freq is unlocked if its winning and the bot runs Event_FlagGrab for the killer.
Any help you can provide is greatly appritiated. Source code attached
Anti-FreqHopping Bot
src.zip - 25.04 KB
File downloaded or viewed 16 time(s)
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Mon Nov 24, 2003 6:41 pm Post subject: |
 |
|
|
|
the Flagger struct i made only includes the name of the player, char[20]. But in a Player struct, it has more than 40 different variables. So in memory spaced, the smaller struct would be more efficient and smaller. CMPSTR() function is much faster for just comparing names than comparing 2 entire Player structs.
flaglist->total does get the total number of flags on there, but it also has UNASSINED(0xFFFF) variables on there for flags that were nueted or havent been picked up. So the only way to do it is to increment a variable for the flaglist. Although a bool might work in there, so the bool will be false if the team doesnt own the entire flaglist but if they do, it will add flaglist->total to the total number of flags they have. Although it may be quicker, i would be using one more variable and there is still that bug i havent found
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Mon Nov 24, 2003 6:43 pm Post subject: |
 |
|
|
|
Quote: | Try making these modifications, and you might find your problem easier to track down. |
yah, lol, a function there would probably make it easier to look at
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Mon Nov 24, 2003 7:39 pm Post subject: |
 |
|
|
|
Cyan~Fire wrote: | linkedlists are only pointers | So, it would actually take less memory.
I'm not just making up this method without trying it. I use something like it in my capital plugin. If you just use a standard == operator, it will be comparing two pointers which will point to the same memory address if they are equal. It's cool how it works out
About the flaglist. Even if a flag is UNASSIGNED in the list, the total should still show it. I don't think the flag entries are actually killed when it is neuted.
The reason I suggested this is not only for simplicity but because of the fact that flag numbers can be random. I haven't thoroughly looked at your code, so I don't know if you accounted for this.
I'm attaching a spawn.h and spawn.cpp with my modifications. I haven't tested them, so they're just to demonstrate what I mean and to implement only if you think it's ok.
Ahh, and just wondering: why did you name your project default??
Spawn.h and .cpp
Didn't do command.cpp as it's just a demo.
musiclock.zip - 6.82 KB
File downloaded or viewed 11 time(s)
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Mon Nov 24, 2003 9:29 pm Post subject: |
 |
|
|
|
lol, i dont know how to change the name of the dll that VC++ pumps out, never really cared. I can just change it anyway.
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Mon Nov 24, 2003 9:38 pm Post subject: |
 |
|
|
|
oh yah, that pointer thing you said makes sence, ill start using that
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Nov 25, 2003 5:33 pm Post subject: |
 |
|
|
|
Oh, and also if you use the Player linkedlist, you can just take out the method DelPlayer() and use "FlaggerList.kill(p)" instead, since it doesn't have to search for the name.
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Nov 25, 2003 6:18 pm Post subject: |
 |
|
|
|
Here's a new version of all three files. I figured out more ways with already-existing linkedlist functions to simplify.
Sorry if I'm "taking your job" but I find playing with others' code very fun
musiclock.zip - 9.15 KB
File downloaded or viewed 9 time(s)
|
|
Back to top |
|
 |
SideBurn Novice

Age:42 Gender: Joined: Aug 31 2003 Posts: 63 Location: uk Offline
|
Posted: Tue Nov 25, 2003 7:56 pm Post subject: |
 |
|
|
|
well i figured summut major wrong about this plugin, like it locks a freq if they got all flags, but if u on a private freq it actually says in arena the freq, so then after that freq is unlocked, every1 knows ur freq, unless this bug has been sorted since i last seen it in action
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Tue Nov 25, 2003 8:19 pm Post subject: |
 |
|
|
|
your talking about catid's musiclock bot. I have a fixed version of that bot if you want it. Just fixed it from telling the priv freq and added some small useful stuff for sysops to it
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Tue Nov 25, 2003 8:33 pm Post subject: |
 |
|
|
|
Because your dead sexy cyan, you can try out my rampage plugin.
Rampage Bot v2 1/2 by 50% Packetloss
rampage.zip - 54.29 KB
File downloaded or viewed 15 time(s)
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 26, 2003 11:49 am Post subject: |
 |
|
|
|
OK, I'll sexily take a look.
Did my modifications work out right?
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 26, 2003 2:06 pm Post subject: |
 |
|
|
|
About the rampage: Catid's way of doing his rampage bot is much easier. Instead of creating a new playerlist, all you do is make a player tag for each player with their kills.
I'm guessing your major improvement on this would be adding in a lot more detail per rampage message. I'm attaching my mod of Catid's rampage that does sounds, I think it would be easier to modify that, instead.
Rampage_cf.zip - 10.95 KB
File downloaded or viewed 11 time(s)
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Wed Nov 26, 2003 4:47 pm Post subject: |
 |
|
|
|
Player tags are the same thing as what i was doing. Instead of making your own struct you're using the existing taglist to do the same work. Which works just as good.
I wanted the recipiant of the bot to be able to use any amount of kills for the killing spree, to be able to edit the messages any way they wanted, be able to prize people, and be able to ignore bots(added in the one that will be on catid's website). Although it is easier to set up catid's rampage.ini, the extra additions in my plugin may come in handy to some zone sysops.
Oh yah, your
if (kills % 3 != 0 && kills <= 30)
{
kills /= 3;
//ect.....
was pretty smart, lol, very sexy
Have a happy thanksgiving (that is if you live in the US)
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 26, 2003 9:52 pm Post subject: |
 |
|
|
|
Lol ya I do, thanks, you too.
I suggested PlayerTags because they already have been set up by Catid. I just think they'd be a bit easier to work with.
And I wasn't suggesting not using any of your improvements, just saying build on the Catid system instead of writing your own.
Lol and yes, my code is awesomely sexy.
|
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Thu Dec 04, 2003 2:38 pm Post subject: |
 |
|
|
|
in VC++.net, you go to Project>Properties and theres a place where you specify the output file
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Dec 04, 2003 4:20 pm Post subject: |
 |
|
|
|
Actually, what I do is just copy deafult's source to a new folder and create a new project myself. I find it a bit cleaner.
|
|
Back to top |
|
 |
|