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
!challenge & !accept

 
Post new topic   Reply to topic Printable version
 View previous topic  mmavs duel limit Post :: Post modifying elim.dll  View next topic  
Author Message
Witchie NL
Seasoned Helper


Age:35
Gender:Gender:Male
Joined: Jul 24 2005
Posts: 112
Location: Veere, Zeeland, Netherlands
Offline

PostPosted: Mon Aug 14, 2006 8:44 am    Post subject: !challenge & !accept Reply to topic Reply with quote

Does anyone have any idea how to implent an !challenge <name> and !accept <name> part in an mervbot plugin. As told in another topic im working on an duel bot (edit from catid's duel.dll) but i have no idea how to build this part.

When done i will post the plugin here.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website MSN Messenger
Witchie NL
Seasoned Helper


Age:35
Gender:Gender:Male
Joined: Jul 24 2005
Posts: 112
Location: Veere, Zeeland, Netherlands
Offline

PostPosted: Mon Aug 14, 2006 8:46 am    Post subject: Reply to topic Reply with quote

It keeps track of scores to.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website MSN Messenger
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Mon Aug 14, 2006 8:52 am    Post subject: Reply to topic Reply with quote

I was just about to start a duel plugin, too.

What part are you having problems at?
Finding the player or saving the challange?

foomy hulk
_________________
It's a shark! Oh my god! Unbelievable!
Back to top
View users profile Send private message Add User to Ignore List
Witchie NL
Seasoned Helper


Age:35
Gender:Gender:Male
Joined: Jul 24 2005
Posts: 112
Location: Veere, Zeeland, Netherlands
Offline

PostPosted: Mon Aug 14, 2006 3:17 pm    Post subject: Reply to topic Reply with quote

saving the challenges. If someone uses it it just scrolls playerlist to the specified player and then pm's him with !accept. but how does the bot remember which player challenged who and how to keep track of that when its realy bussy.

Code: Show/Hide

if (c->check("challenge"))
{
     if (!*c->final) {sendPrivate(p, "Syntax: !challenge <playername>");}
     else
     {
          String challenger, challenged;
          challenger = p->name;
          challenged = c->final;
         
          _listnode <Player> *parse = playerlist->head;      
          while (parse)
          {
                Player *p = parse->item;   
                {
                       if (p->name == challenged)
                       {
                               sendPrivate(p, (String)challenger + " Has challenged you for a duel, !accept to accept the duel!");
                       }
                }
          }
     }
}
else if (c->check("accept"))
{
       if (p->name == challenged)
       {
               sendPrivate(p, "You have accepted the duel");
               sendPrivate(p, "*warpto # #");
               sendPrivate(challenger, "*warpto # #");   
       }
}   


This is what i came up with but this will only work propperly when there are 2 players in the arena.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website MSN Messenger
Witchie NL
Seasoned Helper


Age:35
Gender:Gender:Male
Joined: Jul 24 2005
Posts: 112
Location: Veere, Zeeland, Netherlands
Offline

PostPosted: Mon Aug 14, 2006 3:21 pm    Post subject: Reply to topic Reply with quote

i just wrote that with bare hands and it might be fucked coz this forum doest suport the Tab key. There might be some bug's to but this will explain it a bit.

Ive tryed it with playertag's to but when 2 players challenge the same player its fucked. only allows the 2nd player to duel.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Mon Aug 14, 2006 4:36 pm    Post subject: Reply to topic Reply with quote

Witchie NL wrote:
i just wrote that with bare hands and it might be fucked coz this forum doest suport the Tab key. There might be some bug's to but this will explain it a bit.

Found some code that will allow TABs to be inputted into textareas under IE fine, but with Firefox, it inputs the tab and then it highlights the preview button like before. But at least it puts a copy of a tab in the text box (which you can then copy/paste as needed).
Back to top
View users profile Send private message Add User to Ignore List Send email
D1st0rt
Miss Directed Wannabe


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

PostPosted: Mon Aug 14, 2006 10:52 pm    Post subject: Reply to topic Reply with quote

You could do something like

Code: Show/Hide
struct Challenge{
    Player *challenger;
    Player *challenged;
};

and then either store them in a list or hashmap
_________________

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: Mon Aug 14, 2006 11:31 pm    Post subject: Reply to topic Reply with quote

Or use player tags.
_________________
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
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue Aug 15, 2006 2:44 am    Post subject: Reply to topic Reply with quote

I'd store names instead of Player*'s
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Tue Aug 15, 2006 5:44 am    Post subject: Reply to topic Reply with quote

You could make up a random number.
Tag the challenger with that number, the competitor with that number+1.
That way you can identify both players before the duel.

If a player accepts a duel, simply search for the player with his tag -1.

That might work.
The number can also be some autoincrementing id, which would probably be better.
Back to top
View users profile Send private message Add User to Ignore List
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 Aug 15, 2006 11:53 am    Post subject: Reply to topic Reply with quote

Uhh yeah, auto increment would be a lot better than a random number.

But you could allocate a structure for each duel and make the player tag a pointer to the structure. That would be very easy and simple.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Witchie NL
Seasoned Helper


Age:35
Gender:Gender:Male
Joined: Jul 24 2005
Posts: 112
Location: Veere, Zeeland, Netherlands
Offline

PostPosted: Wed Aug 16, 2006 7:55 am    Post subject: Reply to topic Reply with quote

ok ima try a few things. ima use struct's and the idea about give people tag's with each an unique duelID. ima post the updates here.

currently i have some bs with windows so ima need to reinstal it and tweak everything thing whole again, reinstal all programs etc etc. then ill start working on it.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website MSN Messenger
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: 37 page(s) served in previous 5 minutes.

phpBB Created this page in 0.480362 seconds : 36 queries executed (92.6%): GZIP compression disabled