Back Reply to topic
Mika 
(started thread)
Champion Chicken 
Topics: 6
Posts: 67
Location: Finland
Playing:  AOC
Ingame:  Phaestyriade
Years registered: * * * * * * * * * * *
Wierd Posted: Post 07:18 Fri - Feb 20, 2009

When i use this script,
Code:
<?php
global $myname;
if ($sender!=$myname) {

   $password="xxxx";
   $AuthGood=0;

   /*check if user wants to add a mainchar*/
   if ($pluginwords[1]=="!inviteme") {
      if ($pluginwords[2]!="") {
         $passwordsent=strtr($pluginwords[2], array("\""=>"",">"=>"&gt;","<"=>"&lt;","ä"=>"ae","ö"=>"oe","ü"=>"ue","Ä"=>"Ae","Ö"=>"Oe","Ü"=>"Ue","ß"=>"ss"));
         #$passwordsent=strtoupper(substr($passwordsent,0,1)).substr($passwordsent,1);
         #the bot needs to check the password what was sent, if correct, will invite, if not will tell the user to bugger off
         if ($passwordsent==$password) {
            $AuthGood=1;
         }
         }
         
   }
   }
   
   if ($AuthGood==1) {
            $msg="/guild invite $sender";
            send_guild_channel_message($msg);   
   } else {
            $msg="Sorry, you did not supply the correct password, please try again.";
            send_private_tell($sender,$msg);

            $msg=colortext(":: $sender has asked me to invite them into the guild, but supplied the wrong password ::");
            send_guild_channel_message($msg);   
   
}
?>

Okey when this is running, and i try use like !chuck /"tell pohjola !chuck" i got chuck in say folder, it gives me chuck and then it spams to guild chat that "$sender has asked me to invite them into the guild, but supplied the wrong password " so what is wrong in that guild invite code?
Reply with quote


Chaly 
Offizier · Webmaster 
Topics: 403
Posts: 2106
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * * *
Posted: Post 12:31 Sat - Feb 21, 2009

we already had discussions about automated guildinvites. as far as i know it is still not possible to initiate a guildinvite with a chat-only gameclient (like a bot), this code will only send a "/guild invite $sender" to your guildchannel. however, some of the brackets in the code above were messed up (one of the three brackets in the middle of your code belong to "if ($sender!=$myname)").
Code:
<?php
global $myname;
if ($sender!=$myname) {
   $password="xxxx";

   /*check if user wants to add a mainchar*/
    if ($pluginwords[1]=="!inviteme") {
        if ($pluginwords[2]!="") {
            $passwordsent=strtr($pluginwords[2],
                        array("\""=>"",">"=>"&gt;","<"=>"&lt;","ä"=>"ae","ö"=>"oe","ü"=>"ue","Ä"=>"Ae","Ö"=>"Oe","Ü"=>"Ue","ß"=>"ss"));
            #$passwordsent=strtoupper(substr($passwordsent,0,1)).substr($passwordsent,1);
            #the bot needs to check the password what was sent, if correct, will invite, if not will tell the user to bugger off
            if ($passwordsent==$password) {
                $msg="/guild invite $sender";
                send_guild_channel_message($msg);   
            } else {
                $msg="Sorry, you did not supply the correct password, please try again.";
                send_private_tell($sender,$msg);

                $msg=colortext(":: $sender has asked me to invite them into the guild, but supplied the wrong password ::");
                send_guild_channel_message($msg);   
            }
        }
    }
}
?>
Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
Mika 
(started thread)
Champion Chicken 
Topics: 6
Posts: 67
Location: Finland
Playing:  AOC
Ingame:  Phaestyriade
Years registered: * * * * * * * * * * *
Posted: Post 05:09 Sun - Feb 22, 2009

Yeah it just paste that text to guild channel /guild invite Playername and nothing happens =/ Reply with quote


Back Reply to topic