EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Buff bot script (https://www.eqemulator.org/forums/showthread.php?t=36547)

Dabloon 02-23-2013 09:25 PM

let me check

Dabloon 02-23-2013 09:31 PM

didnt have one of the ports forwarded to right ip. its fixed now so u can try again if u wish

Zamthos 02-23-2013 09:32 PM

There we go, logging in now.

Dabloon 02-23-2013 10:14 PM

Well gambling bot is working sort of. It skips the second quest::say and returns any plat you give it also it always rolls a 0.

heres the script i have so far

#Script for a gambling bot based on random numbers

sub EVENT_SAY {

if ($text =~/Hail/i)
{ quest::say ("Greetings $name. Would you like to place a [wager]?"); }

if (&text =~/wager/i)
{ quest::say ("You place a wager anywhere from one to ten platinum. I then generate a random number between 0 and 10. It works like this. Wager multiplied by the number generated. If you wish to try your luck give me the number of platinum you wish to wagerand i will generate a number for you.");}

sub EVENT_ITEM {

if($platinum == 1)
{
$random_result = 0;
my $random_result = int(rand(10))+1;}

{ quest::say("You rolled a $random_result!");}
{ quest::givecash("0","0","0","$platinum*$random_res ult")}
}
}

Dabloon 02-23-2013 10:15 PM

doh just saw the mistake lol an & sing instead of $ oops

Dabloon 02-23-2013 10:27 PM

Ok fixed the quest say but still getting platinum back and the random is always 0

Zamthos 02-23-2013 10:41 PM

Would you like my gambling script?

Dabloon 02-23-2013 10:42 PM

That would be great and i still cant find my mic lol

Zamthos 02-23-2013 10:42 PM

If the roll is what you said you get back five times what you put in.

Here you go:
Code:

sub EVENT_SAY
{
   
        my $NPCNAME = $npc->GetCleanName();
       
        if($text=~/hail/i)
        {
                $client->Message(315, "$NPCNAME whispers to you, 'Hey there $name, up for some gambling? Pick a number from 1-10 by saying \"number #\", give me some money and if you're lucky and I roll your number you will get back five times the amount of money you put in.'");
    }
        elsif($text=~/number ([0-9]+)/i)
        {
                $numbers{$name} = $1;
                $client->Message(315, "$NPCNAME whispers to you, 'Ok, you picked $1... Hand me your bet and let me grab my dice...'");
    }
}

sub EVENT_ITEM
{
        my $NPCNAME = $npc->GetCleanName();
       
    if(defined($numbers{$name}))
        {
                $client->Message(315, "$NPCNAME whispers to you, 'Ok, your bet is $platinum pp, $gold gp, $silver sp, $copper cp.  Rolling my dice!'");
                $client->Message(315, "$NPCNAME tosses his dice on the ground and looks at the number that comes up.");
                $roll = int(rand(9)+0.5) + 1;
                plugin::Whisper("The roll is $roll!");
               
                if($roll == $numbers{$name})
                {
                        quest::givecash($copper*5,$silver*5,$gold*5,$platinum*5);
                }
                else
                {
                        $client->Message(315, "$NPCNAME whispers to you, 'Oh, too bad, you lose, oh well, let me know if you want to try again.'");
                }
    }
        else
        {
                $client->Message(315, "$NPCNAME whispers to you, 'You have to pick a number first!'");
                quest::givecash($copper, $silver, $gold, $platinum);
                plugin::return_items(\%itemcount);
    }
}


Dabloon 02-23-2013 10:55 PM

lol waiting on the server to catch up bot still using old script even though its been changed and saved

Zamthos 02-23-2013 10:58 PM

Haha, type #reloadpl, the server doesn't naturally reload scripts.

c0ncrete 02-23-2013 11:06 PM

might want to add a check to make sure the client chose a number in the correct range and that it returns all money if no selection was made.

Dabloon 02-23-2013 11:07 PM

The script you posted works for you right?


EDIT: Nm I fixed it by changing plugin::whisper to $client->Message

volkmeer 08-28-2013 08:07 AM

I am trying to use Zamathos's script but it will not cast group buffs only single player. While in a group it will only single character that hails, speed, KEI, cure, heal.

Any ideas on how to get this to work to cast group buffs? Maybe even an option to click group or solo?

I am not a programmer, but I have a solo server for me and my 10 year old step son to play on that I am adding customizations.

Volkmeer

rencro 08-28-2013 12:15 PM

Zamthos released all his code, you can find more info in the link below. In his quests directory, under poearthb, the Verdai.pl script is the one you want. Thanks again Zamthos...

http://www.eqemulator.org/forums/showthread.php?t=37185


All times are GMT -4. The time now is 05:41 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.