Server Help

Bot Questions - Bot Question

Irapliskin - Sun Mar 25, 2007 10:46 pm
Post subject: Bot Question
I was wondering if someone could help me with a question

I want my bot warp everyone to the co-ords i give it when i type !Warpall What do i have to do to do this
Animate Dreams - Sun Mar 25, 2007 11:51 pm
Post subject:
Why not do it yourself with a mod command, *warp?
BDwinsAlt - Mon Mar 26, 2007 12:15 am
Post subject:
OMG hey irap! How's it going?
Been a while since you gave me that prorat trojan. icon_biggrin.gif

What I would do if look at the loop like on the merv tutorial:

Code: Show/Hide

// Inside your command already.

_listnode <Player> *parse = playerlist->head;   //set to first link of the player linked list

while (parse)   //parse will be NULL when we reach the last link
{
   Player *p = parse->item;   //item is the actual data stored in the link

   // do functionality here
   // Example 1: sendPrivate(p,"*watchdamage"); // turns on all pilot's watchdamage
   // Example 2: if (p->safety != 0) sendPrivate(p,"*spec"); // spec all pilots in safe zone
         sendPrivate(p, "*warpto %s %s", xcoord, ycoord);  // Might work?
   parse = parse->next;   //set parse to the next link
}


Erm not sure how to split a string in C++. Google to the rescue!

Note: I had no way to test this. I don't even really use C++ or Merv.
Would this work?
Code: Show/Hide

string xcoord;
string ycoord;
. . .
xcoord, ycoord = c->final.split(":");   // Completely guessing here.

Maverick - Mon Mar 26, 2007 3:51 am
Post subject:
My plugin, Generalbot, can do this. (Mervbot)

You can download it here.
Irapliskin - Sun Apr 01, 2007 9:00 pm
Post subject: Thanks
Thanks Guys, and Sorry bout that BD, that was a while back when i was a script kiddie tongue.gif anyways. thanks..it worked perfect
Witchie NL - Mon Apr 02, 2007 3:44 am
Post subject:
Code: Show/Hide

// Inside your command already.

_listnode <Player> *parse = playerlist->head;

while (parse)
{
   Player *p = parse->item;

         sendPrivate(p, "*warpto "+(String)xcoord+" "+(String)ycoord);  // Will work if xcoord and ycoord are decleared as variables

   parse = parse->next;   
}


Code: Show/Hide

String xcoord, ycoord;

ycoord = c->final;
xcoord = ycoord.split(":");   // Leave the right part besides : in ycoord and put the part infront of : in xcoord


This should do the trick.

This should work
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group