Buff bot script
Here is a buffbot script i made. It may not be the best available but it works. With some exceptions though. I have 8 buffs in the script but it is only casting 5. Im not sure if I have IDs wrong or if its a level issue or a bug. I tested the script on the latest eqemu source and peq db with a level 85 toon.
# A script for a buff bot sub EVENT_SAY { if ($text =~/Hail/i) { quest::say ("Hello $name. Would you like some [free buffs] or a [heal] to help you on your travels?"); } if ($text=~/free buffs/i) {quest::say ("There you go. Enjoy your free buffs"); quest::selfcast(278); quest::selfcast(457); quest::selfcast(1693); quest::selfcast(2176); quest::selfcast(2177); quest::selfcast(3692); quest::selfcast(3467); quest::selfcast(2570); } elsif ($text =~/heal/i) { quest::say ("There you go your all patched up $name"); quest::selfcast(13); } } If anyone can tell me whats wrong it would be greatly appreciated Note: This is my very first perl script Note2: The smiley face is an 8 not sure why its a smiley face lol |
"...your all patched up", Hehe. And what do you mean what's wrong with it? It's pretty basic, you could make it more complex, but it's not completely necessary. Question?: Why are the buffs are equal for levels 1-85. I would change quest::say to plugin::Whisper unless you want to flood your chat, my edits below. Sorry for being so blunt. You could also add saylinks.
Edit: Also, post scripts within Code blocks, [ code ]* before, [ /code ]* one line after the end of the script. *NO Spaces. Code:
# A script for a buff bot |
The issue i was having is it isnt casting all the buffs and thank you by the way for the tips
|
Is it still not casting all the buffs? And no problem, if you would like a buff bot based upon level, just ask. Haha.
|
That would be great. Made this script as an experiment trying to learn a bit of perl
|
Here you go, all the way to 85.
Code:
@SpellName10 = ("Center", "Spirit of Bear", "Feet like Cat", "Dextrous Aura", "Strengthen", "Quickness", "Breeze", "Spirit of Wolf", "Shield of Brambles", "Complete Heal"); |
lol that worked great thank you. Casts without saying anything after hail though but great none the less. To be honest im perfectly ok with that. My server isnt that populated (usually just me) so it isnt a big deal and thanks again for the script
|
No problem, haha.
|
One of my future projects is a gambling bot but im net yet working on that 1
|
instead of the blocks that look like this
Code:
$Group->CastGroupSpell($npc, $spellID10[$n]); Code:
$Group->CastGroupSpell($npc, $_) for @spellID10; |
0.o I just happen to have one of those too, but I'd like to see how you make yours before I give you mine. Haha.
|
Reserching for it now hehe
|
Thanks C0ncrete, I wrote that script a while back, almost 2 months ago, hehe.
|
Was thinking of using the rand function to generate random numbers but having issues figuring out how to get it to display the result of rand in quest::say
|
Code:
$random_result = 0; Code:
quest::say("You rolled a $random_result!"); |
Thanks man you rock
|
Thanks man you rock
|
If i wanted the npc to give money equal to $random_result would it be something like
quest::givecash("0","0","0","1*$random_result"); |
there is no need to use quotations around numbers.
there is also no need to multiply a number by 1, since you just get the same number. |
The idea behind 1*$random_result is like say a player gives 1 platinum and the $random_result is 5 then the player would recieve 5 platinum. Basically 1*5.
Say they gave 2 platinum then it would be 2*$random_result and say the random was 5 the player would then recieve 10 platinum etc etc according to how much plat they gave |
You would do this:
Code:
quest::givecash($copper*$random_result,$silver*$random_result,$gold*$random_result,$platinum*$random_result); |
you should also be aware that int(rand(10)) will only ever return 0 - 9.
if you want it to return 1 - 10, you need to use int(rand(10))+1. |
Thanks for the help guys will try that out
|
You're welcome. May I ask if your server is public or privately hosted?
|
If by public you mean others can play on it then yes its public but its hosted here at my home on a road runner connection.
|
I had Road Runner, they're pretty good, I just hate their router setup, what is the name of your server, sir?
|
FBT double xp no charge buffbot
|
Can you log on so we can play together? Also, is it RoF Compatible?
EDIT: Can't connect, I load for 5 minutes and disconnect. |
Im on now testing gambling bot and yes ROF should work
|
Your server isn't allowing outside connections, is it port-forwarded correctly? 0.o
|
let me check
|
didnt have one of the ports forwarded to right ip. its fixed now so u can try again if u wish
|
There we go, logging in now.
|
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")} } } |
doh just saw the mistake lol an & sing instead of $ oops
|
Ok fixed the quest say but still getting platinum back and the random is always 0
|
Would you like my gambling script?
|
That would be great and i still cant find my mic lol
|
If the roll is what you said you get back five times what you put in.
Here you go: Code:
sub EVENT_SAY |
lol waiting on the server to catch up bot still using old script even though its been changed and saved
|
All times are GMT -4. The time now is 07:41 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.