Back Reply to topic
Goto page 1, 2  Next
Nohma 
(started thread)
Blue-Ribbon Chicken 
Topics: 3
Posts: 7
Playing:  AoC
Ingame:  Nohma
Years registered: * * * * * * * * * * *
Release: Random/Roll Plugin Posted: Post 07:34 Wed - Jun 25, 2008

A little random roll plugin for you (like in WoW)

hope you like it, zwinkern

!random 50 => range 1-50

!random => range 1-100

so long


Random_Roll.rar
 Description:
Random Roll Plugin

Download
 Filename:  Random_Roll.rar
 Filesize:  338 Bytes
 Downloaded:  612 Time(s)

Reply with quote


Guest 
 
Topics: 3
 
 
 
Posted: Post 11:43 Wed - Jun 25, 2008

thx lachen Reply with quote


Snibbeldibbel 
Blue-Ribbon Chicken 
Topics: 3
Posts: 17
 
 
Years registered: * * * * * * * * * * *
Posted: Post 09:54 Wed - Jun 25, 2008

mhm, is it possible to send it to the "group"channel? Reply with quote


kardson 
Topfight Chicken 
Topics: 6
Posts: 38
Playing:  AOC
Ingame:  kardson
Years registered: * * * * * * * * * * *
Posted: Post 10:39 Wed - Jun 25, 2008

Not unless the bot is in the group with you. Reply with quote


Chaly 
Offizier · Webmaster 
Topics: 403
Posts: 2106
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * *
Posted: Post 11:17 Wed - Jun 25, 2008

AO bots save their !rolls, give them a number and reply:
"i roll from 1 to 50. result: 42. to verify /tell ragebot !verify 8882"
where 8882 is an increasing number.. anyone can tell the bot to proove the !roll result. as the bot restarts from time to time it isn't that easy to make an increasing number, but not impossible. an idea for this:

loading of a rollcounter after bot-restart:
Code:

/* check of $pluginwords is somwhere above */

global $RollCounter;
if (unset($RollCounter)) {
  $b=0;
  $f1=fopen($currentplugin."/history/index","r");
  if ($f1) $b=fread($f1,1024);
  if ($f1) fclose($f1);
  if (is_numeric($b)) {
    $RollCounter=0+$b;
  } else {
    $RollCounter=1;
  }
}

/* doing the !roll is here, result in $result, the !verify number is $RollCounter*/

/*make sure the code below is only executed when the !roll command was successfull .. maybe if ($roll>0)*/

/*save the file with the result.. file is namend $RollCounter*/
$f1=fopen($currentplugin."/history/".$RollCounter,"w+");
if ($f1) fwrite($f1,$result);
if ($f1) fclose($f1);

/*save the $RollCounter for the next !roll-*
$RollCounter++;
$f1=fopen($currentplugin."/history/index","w+");
if ($f1) fwrite($f1,$RollCounter);
if ($f1) fclose($f1);

todo: a second function for $pluginwords[0]=="!verify" that opens the roll- file, reads its contents and send the contents as a tell. rollcounter-file may be read-in like this:
Code:
if (is_numeric($pluginwords[1]) && $pluginwords[1] >0) {
  $rollfilename=$currentplugin."/history/".$pluginwords[1];
  $f1=fopen($currentplugin."/history/".$pluginwords[1],"r");
  if ($f1) $b=fread($f1,1024);
  if ($f1) close($f1);
  if ($b>0) {
    /* $b should now contain the value of the specific !roll.. do a reply here :) */
  } else {
     /* file cannot be read.. maybe the pluginwords[1] was numeric but the roll doesn't exist..? do a reply here :) */
  }
}


hope there isn't a syntaxerr... gn8 zwinkern
Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
Dustie 
Blue-Ribbon Chicken 
Topics: 0
Posts: 3
Playing:  AOC
Ingame:  Dustie
Years registered: * * * * * * * * * * *
Posted: Post 01:09 Fri - Sep 26, 2008

Hi i have tried out this Plugin , but it's roll only from 1-100 . The Plugin don't accept other numbers . Can me anyone tell me what i can do ? Reply with quote


TrueMOD 
Blue-Ribbon Chicken 
Topics: 1
Posts: 4
Location: Germany
Playing:  Age of Conan
Ingame:  Truemod
Years registered: * * * * * * * * * * *
Posted: Post 07:47 Tue - Sep 30, 2008

same problem for me...I also noticed in the php code it is supposed to send the result along with the guild name to the public channel? Or am I taking something wrong from that. Anyway it answers in guild and it only reacts to 100 as $max...doesnt accept the $pluginwords[2] no matter what number you try Reply with quote


Chaly 
Offizier · Webmaster 
Topics: 403
Posts: 2106
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * *
Posted: Post 11:58 Sun - Oct 05, 2008

this should do the work..
as this is untested your feedback would be helpfull zwinkern


RandomRoll.zip
 Description:

Download
 Filename:  RandomRoll.zip
 Filesize:  336 Bytes
 Downloaded:  492 Time(s)

Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
Dustie 
Blue-Ribbon Chicken 
Topics: 0
Posts: 3
Playing:  AOC
Ingame:  Dustie
Years registered: * * * * * * * * * * *
Posted: Post 11:52 Sun - Oct 05, 2008

Hello again.
I have tried out this , but it doesn't change anything . The same problem with the new version.
Reply with quote


Argorn 
Blue-Ribbon Chicken 
Topics: 5
Posts: 19
Playing:  Age of Conan
Ingame:  Argorn
Years registered: * * * * * * * * * * *
Posted: Post 02:25 Tue - Oct 07, 2008

Hmm...

I changed the code to:

Code:
<?php
if ($pluginwords[1]=="!roll") {
   if (is_numeric($pluginwords[2]) && $pluginwords[2]>1) {
      $max=$pluginwords[2];
   } else {
      $max=100;
   }
   $wurf=rand(1,$max);
   $msg="$sender" . " " . "würfelt" . " " . "$wurf" . " " . "von $max";
   send_reply(colortext($msg));
}
?>


...but no change as well, always rolling out of 100. for the
Code:
else {$max=100}

shouldnt it be something like else if pluginword2 ="", means it only will be handled if the pluginword 2 is missing?


Regards
Reply with quote



_________________

Argorn (80) : Miezekatze (80) ::: NR Guild Leader
Chaly 
Offizier · Webmaster 
Topics: 403
Posts: 2106
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * *
Posted: Post 07:53 Tue - Oct 07, 2008

wtf?sry,i'm in a hurry,but at least:
Code:
<?php
if ($pluginwords[1]=="!random") {
   $lbound = 1;
   $ubound = ($pluginwords[2]+0 > 1) ? $pluginwords[2] : 100;
   $msg="$sender rolls and gets " . rand($lbound,$ubound) . " out of $max";
   send_reply(colortext($msg));
}
?>
Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
Dustie 
Blue-Ribbon Chicken 
Topics: 0
Posts: 3
Playing:  AOC
Ingame:  Dustie
Years registered: * * * * * * * * * * *
Posted: Post 08:25 Sun - Oct 12, 2008

Hmm sry but now make the plugin the same ...
It's not available to write own numbers . He rolls only betwen 1-100
Quote:
<?php
if ($pluginwords[1]=="!random") {
$lbound = 1;
$ubound = ($pluginwords[2]+0 > 1) ? $pluginwords[2] : 100;
$msg="$sender rolls and gets " . rand($lbound,$ubound) . " out of $max";
send_reply(colortext($msg));
}
?>

I think there is an error in the 5 line , where the output $msg say : get $max .
There is no definition in the file what $max is.
I have tryed out this but it doesnt work :
Quote:
<?php
if ($pluginwords[1]=="!random") {
$lbound = 1;
$ubound = ($pluginwords[2]+0 > 1) ? $pluginwords[2] : 100;
{ $max=$pluginmessage; } (and I tryed it out with pluginword[2])
$msg="$sender rolls and gets " . rand($lbound,$ubound) . " out of $max";
send_reply(colortext($msg));
}
?>

Sorry for my english
Reply with quote


Goto page 1, 2  Next
Back Reply to topic