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
Recreating the MusicLock bot, but there is a error

 
Post new topic   Reply to topic Printable version
 View previous topic  Lvz Bot Post :: Post make MERVBot 39 shut up  View next topic  
Author Message
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Sun Nov 23, 2003 2:55 pm    Post subject: Recreating the MusicLock bot, but there is a error Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Nov 24, 2003 6:10 pm    Post subject: Reply to topic Reply with quote

I'm thinking it would be a lot easier to make a separate linkedlist of Player structs, instead of making a new Flagger struct. This would allow you to eliminate GetPlayer() and simplify many other operations you perform. As linkedlists are only pointers, this actually would (I think) take up less memory. You can also use flaglist->total instead of making a new variable for it. Also, it seems a little more reliable to me to use the flaglist for GetFlagCount() instead of playerlist:
Code: Show/Hide
Uint16 botInfo::GetFlagCount(Uint16 Freq)
{
   int count = 0;
   for(_listnode <Flag> *parse = flaglist->head; parse; parse=parse->next)
   {
      if (parse->item->team == Freq)
         count++;
   }
   return count;
}


Try making these modifications, and you might find your problem easier to track down.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Mon Nov 24, 2003 6:41 pm    Post subject: Reply to topic Reply with quote

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 icon_sad.gif
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Mon Nov 24, 2003 6:43 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Nov 24, 2003 7:39 pm    Post subject: Reply to topic Reply with quote

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 icon_razz.gif

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. icon_razz.gif

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
View users profile Send private message Add User to Ignore List Visit posters website
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Mon Nov 24, 2003 9:29 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Mon Nov 24, 2003 9:38 pm    Post subject: Reply to topic Reply with quote

oh yah, that pointer thing you said makes sence, ill start using that
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Tue Nov 25, 2003 5:33 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Tue Nov 25, 2003 6:18 pm    Post subject: Reply to topic Reply with quote

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 icon_razz.gif




musiclock.zip - 9.15 KB
File downloaded or viewed 9 time(s)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
SideBurn
Novice


Age:42
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 63
Location: uk
Offline

PostPosted: Tue Nov 25, 2003 7:56 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address MSN Messenger
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Tue Nov 25, 2003 8:19 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Tue Nov 25, 2003 8:33 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Nov 26, 2003 11:49 am    Post subject: Reply to topic Reply with quote

OK, I'll sexily take a look. icon_razz.gif

Did my modifications work out right?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Nov 26, 2003 2:06 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Wed Nov 26, 2003 4:47 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Nov 26, 2003 9:52 pm    Post subject: Reply to topic Reply with quote

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. icon_wink.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Thu Dec 04, 2003 2:38 pm    Post subject: Reply to topic Reply with quote

in VC++.net, you go to Project>Properties and theres a place where you specify the output file
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Thu Dec 04, 2003 4:20 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
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: 41 page(s) served in previous 5 minutes.

phpBB Created this page in 0.450741 seconds : 44 queries executed (91.5%): GZIP compression disabled