Drunk Bot
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Drunk Bot

Started by BlazeXxX, 31 October, 2003, 03:24:11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BlazeXxX

-- Start Copying from this line
--// Drunk Bot
--// A Drunk and Dissorderly Bot
--// By Chaggydawg
--// Version 0.5b --First Public release, please people troubleshoot this
--// What have I got myself in for?
--// oh my god how will i do this.....


--// Variables
drunkName = "[ADSL]Janine"  --// Drunks Name (of course coming from me what'dyou expect)
offon = 1                   --// Is Drunk Bot off or on at script start (0=off, 1=on)
AbuseInterval = 30000       --// Time Interval Between Abuse (Default 30 seconds [30000])
tolerence = (60)             --// Time to work off one drink [##*AbuseInterval] (Default 30 minutes)
sleepmumble = 900000        --// How often Drunk mumbles in their sleep (Default once every 15 minutes [900000]) (Drunk will mumble 8 times then wake up)
--// DO NOT CHANGE VARIABLES BELOW HERE!! Do so at your own risk!!!!
drinkLevel = 1              --// How Many Drinks Does Drunk Have In Him to Start (Default 1)
sleepingTime = 8           --// How Long To Sleep to be sober [#*sleepmumble] (Default 2 hours)
isSleeping = 0              --// 0=Awake  1=Asleep (Default is Awake)
tolerenceLevel = 0
sleeptemp = 0
--// DO NOT CHANGE VARIABLES ABOVE HERE!! Do so at your own risk!!!!

--// Commands
givedrink = "drunk.drink"
puttosleep = "drunk.sleep"
howmany = "drunk.howmany"
turnoff = "drunk.off"
turnon = "drunk.on"
help = "drunk.help"

--// Arrays
--// you can erase the other names but you should atleast leave the bartender so there are no errors
theAbused = {
"Bartender",
"SkyBot",
"crazybot",
}

--// Abuse Arrays - The things drunks says at certain levels of drunkeness
abuse1 = {
"I'm Not Drunk at all. Hey [ABUSED] Buy Me a Drink!!",
"Hey [a] Are we gonna start Drinking or what?",
"Who in here can buy me a drink?",
"Oh man, I really need another beer!",
"Who do I have to screw to get a drink around here?",
"Come on someone buy me a drink, you got any money [a]?",
"*takes big drink*",
}
abuse2 = {
"I'm catching a small buzz",
"Now this party is going gooood!",
"I still need more drinks!",
"Someone pass me a drink.",
"I can sorta feel a buzz, but I still need more!",
"Hahaaaaahaaaa....",
"*Begins Dancing*",
"Hey [a], loan me a few bucks for some drinks!",
"Its my birthday!! [a] why don't you get me a drink?",
"All American beer sucks!",
"hik!",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"this bud's for me! *gulp*",
}
abuse3 = {
"I'm feeling it goods now...",
"Hey look at that elf girl go! yeeeehoooo!!",
"Someone needs to drink with me, how about it [a]?",
"Hey [a] you still got any money left?",
"Guys, I wanna get drunk, help me out...",
"Beer, Beer, Have no fear its Jusss beeeer!",
"I'n gnot as think as you drunk I am.",
"gulp, gulp, gulp",
"Bartender! pour me another!",
"I can drink 16 six packs!",
"aye... I'll drink any man under the table!",
"*reaches for another beer*",
"*burp*",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"I need some more budweiser",
"somebody pour me a big glass of Guinness Stout.",
"anyone ever try a wild turkey?",
"I love beer!",
"I love vodka!",
"I took 14 shots of mad dog once!",
"itth myth speetthch slurrererrred????",
"I think alll mi beer is iampring mi typppin abillty?!?",
"someone get me a beer!",
"beer is awesome!",
"humans can not live by beer alone! But I'd like to try!",
}
abuse4 = {
"ShadUp [ABUSED]! Iing nah drungk!",
"HAHAAAAAahahahaaa BZZZZZZZZzz HAHAAaaa!",
"Weehooo!! yah HHAAHhahahAHaa!!",
"Lettz storm the bar!! whos wit meh?",
"pass the bottle",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"aye... I'll drink any man under the table!",
"*reaches for another beer*",
"*burp*",
"gulp, gulp, gulp",
"Bartender! pour me another!",
"I can drink 16 six packs!",
"aye... I'll drink any man under the table!",
"*reaches for another beer*",
"*burp*",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"I need some more budweiser",
"somebody pour me a big glass of Guinness Stout.",
"anyone ever try a wild turkey?",
"I love beer!",
}
abuse5 = {
"Where thuh ell dih althese elephamants gum frum?",
"I gneed nother dsrink! Pass it over here.",
"*Runs in the bathroom and comes back out a minute later*",
"*Takes of shirt and begins dancing on tabletop*",
"Who'll dares me to runnn owside nekked?",
"I am thirssy...",
"*takes a shot*",
"I need another cooooool one",
"I'll kick your ass [a], buy me a beer I might forgive you though!",
"gulp, gulp, gulp",
"Bartender! pour me another!",
"I can drink 16 six packs!",
"aye... I'll drink any man under the table!",
"*reaches for another beer*",
"*burp*",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"I need some more budweiser",
"somebody pour me a big glass of Guinness Stout.",
"anyone ever try a wild turkey?",
"I love beer!",
}
abuse6 = {
"I love you guys, your my best friends, hic!",
"*SPEWW!! HORF BARFG!",
"You guyz all suuuuuck!! hehehhahaha!",
"*Falls down*",
"Gimme aznuther sdrink [a]!",
"HEY!! ummm, yooou, yah you... [a]! yah []! buy me a drink buddy!",
"Yoos guys needz jobbbs, I needz drings.",
"One more fors thee rooooood... hEHeHEHEHehHEehAAA! but comes on [a] jussss wun more!!",
}
abuse7 = {
"SNORE.....snore.....SNO-hic-RE!!",
"Hmphhmmph, smack smack, SNOOOOORE!!",
"*Rolls over*",
"*Mummbles incoherently*",
"oo...noo....stup...d..bears....ge....way....from me...nooo...",
"Snore......Snore.......SNORE!!......SNOOOORE....snortle..cough..smack smack...sigh",
"juss..one....more wo.....urt meeee.......Snore...snore",
}

--// END Drunk Phrases


--// This function is fired at the serving start
function Main()
SetTimer(AbuseInterval)
frmHub:RegBot(drunkName)
StartTimer()
end

--// This function is fired when a new data arrives
function DataArrival(curUser, Data)
s,e,inpm = strfind(Data,"($To:)")
s,e,cmd = strfind(Data,"%b<>%s(.*)")
if inpm == nil then
if cmd ~= nil then
--// removing endpipe
cmd = strsub(cmd,0,strlen(cmd)-1)
--// handling commands
if cmd == givedrink then dodrink(curUser) return 1
elseif cmd == puttosleep then dosleep(curUser) return 1
elseif cmd == howmany then dohowmany() return 1
elseif cmd == help then dohelp(curUser) return 1
elseif cmd == turnoff then dodrunkoff(curUser) return 1
elseif cmd == turnon then dodrunkon(curUser) return 1
end
end
end
end

function dohelp(curUser)
SendToNick(curUser.sName," Commands For The Drunk Bot:")
SendToNick(curUser.sName,givedrink.."      Give the Drunk a Drink")
SendToNick(curUser.sName,puttosleep.."      Slip the Drunk a Mickey")
SendToNick(curUser.sName,howmany.."   Ask how many drinks Drunk Has Had")
SendToNick(curUser.sName,turnoff.."      Turn off Drunk Bot")
SendToNick(curUser.sName,turnon.."      Turn On Drunk Bot")
SendToNick(curUser.sName,help.."      Display this Help Screen")
end

function dohowmany()
SendToAll(drunkName,"I've only had "..random(1,drinkLevel).." drinks.")
SendToAll("Bartender"," *Slips you a note that says "..drinkLevel.." drinks on it*")
end

function dodrink(curUser)
drinkLevel = (drinkLevel + 1)
SendToAll("Bartender",curUser.sName.." buys "..drunkName.." a Drink.")
SendToAll(drunkName,"Thanx "..curUser.sName.."!! I love drinks")
end

function dodrunkon(curUser)
if GetProfileName(curUser.iProfile) ~= nil then
offon = 1
end
end

function dodrunkoff(curUser)
if GetProfileName(curUser.iProfile) ~= nil then
offon = 0
end
end

function dosleep(curUser)
if isSleeping ~= 1 then
SetTimer(sleepmumble)
if curUser ~= drunkName then
SendToAll(curUser.sName, "*Slips "..drunkName.." a mickey*")
end
SendToAll(drunkName, "*Falls over on floor and passes out*")
abusephrase = gsub(abuse7[random(1,getn(abuse7))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
isSleeping = 1
end
end

function OnTimer()
if offon ~= 0 then
if isSleeping ~= 1 then
if drinkLevel > 30 then
dosleep(drunkName)
elseif drinkLevel > 20 and drinkLevel <= 30 then
abusephrase = gsub(abuse6[random(1,getn(abuse6))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 16 and drinkLevel <= 20 then
abusephrase = gsub(abuse5[random(1,getn(abuse5))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 12 and drinkLevel <= 16 then
abusephrase = gsub(abuse4[random(1,getn(abuse4))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 8 and drinkLevel <= 12 then
abusephrase = gsub(abuse3[random(1,getn(abuse3))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 4 and drinkLevel <= 8 then
abusephrase = gsub(abuse2[random(1,getn(abuse2))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 0 and drinkLevel <= 4 then
abusephrase = gsub(abuse1[random(1,getn(abuse1))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
end
end
end
--// Drinks wearing off after time
if offon == 1 then
tolerenceLevel = tolerenceLevel + 1
if tolerenceLevel >= tolerence then
tolerenceLevel = 0
if drinkLevel > 1 then
drinkLevel = drinkLevel - 1
end
end
end
--// Sleeping timer action
if offon == 1 then
if isSleeping == 1 then
sleeptemp = sleeptemp + 1
SendToAll(drunkName, sleeptemp)
if sleeptemp < sleepingTime then
SendToAll(drunkName,abuse7[random(1,getn(abuse7))])
elseif sleeptemp >= sleepingTime then
isSleeping = 0
SendToAll(drunkName,"*Yawn* I feel so Refreshed!! *Cracks open a Beer*")
SendToAll(drunkName,"*Drinks down the Beer* Alrighty, Who's got another beer for me?")
drinkLevel = 1
SetTimer(AbuseInterval)
end
end
end
end


--// Add remove user logging in/out

--// This function is fired when a new user finishes the login
function NewUserConnected(curUser)
AddUser(theAbused,curUser)
end


--// This function is fired when an operator enters the hub
function OpConnected(curUser)
AddUser(theAbused,curUser)
end

--// This function is fired when an user disconnects
function UserDisconnected(curUser)
RemoveUser(theAbused,curUser)
end

--// This function is fired when an operator disconnects
function OpDisconnected(curUser)
RemoveUser(theAbused,curUser)
end


--//
--// RabidWombat's binarysearch function (I am so confused I hope it works)
--// With not-very-Modified Bonki add/remove user Script
--//

function RemoveUser(tTable, uUser)
local iFind = BinarySearch(tTable, uUser.sName);

if(iFind ~= -1) then
tremove(tTable, iFind);
return 1;
else
return 0;
end;
end

function AddUser(tTable, uUser)
local iFind, iInsert = BinarySearch(tTable, uUser.sName);

if(iFind == -1) then
tinsert(tTable, iInsert, uUser.sName);
return 1;
else
return 0;
end;
end

function BinarySearch(tTable, SearchVar)
   assert(tTable and SearchVar);

   local iBot, iMid, iTop = 1, nil, getn(tTable);
   local CompVal = nil;

   if(getn(tTable) == 0) then return -1, 1; end

   while(iBot <= iTop) do
      iMid = floor((iTop + iBot) / 2);

      CompVal = tTable[iMid];

      if(CompVal == nil) then return -1, -1; end

      if(SearchVar < CompVal) then
         iTop = iMid - 1;
      elseif(SearchVar > CompVal) then
         iBot = iMid + 1;
      else
         return iMid, -1;
      end
   end

   if(SearchVar > CompVal) then
      iMid = iMid + 1;
   end

   return -1, iMid;
end

-- Finish Copying

Gnuff?

Thanks for the script, just what i needed..

Hope to see more scripts from you

Gnuff
Gnuff

BlazeXxX

Oh No !!! Its not written by me.. pls see the credits in the script..

--// By Chaggydawg

Gnuff?

I?ve notised!

But i haven?t been able to find the script like the one you postet.

The script at Chaggydawgs HP is different, and i haven?t been able to make that work.
The one you postet here, was only a scrip, at Chaggydawgs hp it?s a scrip and a txtfile.
Gnuff


cfc

Hi.....

I am a complete newbie so .....can anyone please tell me how to get the commands to work... i have changed the following...(***** = user names)...

--// Commands
givedrink = "drunk.drink"
puttosleep = "drunk.sleep"
howmany = "drunk.howmany"
turnoff = "drunk.off"
turnon = "drunk.on"
help = "drunk.help"

--// Arrays
--// you can erase the other names but you should atleast leave the bartender so there are no errors
theAbused = {
"****",
"*********",
"bartender",
"-={OpChat}=-",
"******",
"**********",
"-={VipChat}=-",
}

I have tried typing stuff like .. givedrink..... but nothing happens        do i need to put a " ! " or something first?

thanks in advance   :D

pHaTTy

try the command drunk.drink
Resistance is futile!

cfc

Thanks m8...... Works a treat......:)

a drink i owe you

pHaTTy

hahah its np, happy to help ;)
Resistance is futile!

chaggydawg

Hi Guys :)

Glad you like the script, some people have trouble with the commands.

If you would like to change them, just change the part between quotes in commands area:


--// Commands
givedrink = "drunk.drink "
puttosleep = "drunk.sleep "
howmany = "drunk.howmany "
turnoff = "drunk.off "
turnon = "drunk.on "
help = "drunk.help "


to something like:

--// Commands
givedrink = "+givedrink "
puttosleep = "+knockout "
howmany = "+drinkcounter "
turnoff = "+drunkbotoff "
turnon = "+drunkboton "
help = "+AlcoholicsAnonymous "


be sure to back up script file if your not sure how to modify it :)

Enjoy!

-chaggydawg

p.s.
My HD recently crashed hard, so my homepage is down and will be down for a little while while I rebuild it.

Bengan 65

Thanxx i just love that script...

WILDCAT

i have drunkbot installed (i'm running Ptokax 0.3.3.0 build 15.25) and i keep getting this error.

Syntax error: bad argument #1 to `getn' (table expected, got nil)
stack traceback:
   1:  function `getn' [C]
   2:  function `OnTimer' at line 137 [file `...0_15.25\PtokaX_0.330_15.25\scripts\DrunkBot.lua']


although i did change only the commands to give the bot drinks and stuff. and added a few more user names.


--// Commands
givedrink = "!givedrink"
puttosleep = "!passedout"
howmany = "!drinkcounter"
turnoff = "!drunkbotoff"
turnon = "!drunkboton"
help = "!AA"

and i also changed this or i mean i added a few more user names to the script.  the **** represent a users nickname, but i left the Bartender just like it said so i wouldn't get any error but i'm still getting them, but i don't know if it's related to adding more nicknames.

theAbused = {
"Bartender",
"************",
"********",
"***********",
"********",
}


can somebody please help me.  :(

THX
WILDCAT

Madman

You dont have the same version as the one posted above...
thats my guess....
create a txt file called drunktriggs in the script folder, and then paste this to it...

--// Abuse Arrays - The things drunks says at certain levels of drunkeness

abuse1 = {
"I'm Not Drunk at all. Hey [ABUSED] Buy Me a Drink!!",
"Hey [a] Are we gonna start Drinking or what?",
"Who in here can buy me a drink?",
"Oh man, I really need another beer!",
"Who do I have to screw to get a drink around here?",
"Come on someone buy me a drink, you got any money [a]?",
"*takes big drink*",
}
abuse2 = {
"I'm catching a small buzz",
"Now this party is going gooood!",
"I still need more drinks!",
"Someone pass me a drink.",
"I can sorta feel a buzz, but I still need more!",
"Hahaaaaahaaaa....",
"*Begins Dancing*",
"Hey [a], loan me a few bucks for some drinks!",
"Its my birthday!! [a] why don't you get me a drink?",
"All American beer sucks!",
"hik!",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"this bud's for me! *gulp*",
}
abuse3 = {
"I'm feeling it goods now...",
"Hey look at that elf girl go! yeeeehoooo!!",
"Someone needs to drink with me, how about it [a]?",
"Hey [a] you still got any money left?",
"Guys, I wanna get drunk, help me out...",
"Beer, Beer, Have no fear its Jusss beeeer!",
"I'n gnot as think as you drunk I am.",
"gulp, gulp, gulp",
"Bartender! pour me another!",
"I can drink 16 six packs!",
"aye... I'll drink any man under the table!",
"*reaches for another beer*",
"*burp*",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"I need some more budweiser",
"somebody pour me a big glass of Guinness Stout.",
"anyone ever try a wild turkey?",
"I love beer!",
"I love vodka!",
"I took 14 shots of mad dog once!",
"itth myth speetthch slurrererrred????",
"I think alll mi beer is iampring mi typppin abillty?!?",
"someone get me a beer!",
"beer is awesome!",
"humans can not live by beer alone! But I'd like to try!",
}
abuse4 = {
"ShadUp [ABUSED]! Iing nah drungk!",
"HAHAAAAAahahahaaa BZZZZZZZZzz HAHAAaaa!",
"Weehooo!! yah HHAAHhahahAHaa!!",
"Lettz storm the bar!! whos wit meh?",
"pass the bottle",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"aye... I'll drink any man under the table!",
"*reaches for another beer*",
"*burp*",
"gulp, gulp, gulp",
"Bartender! pour me another!",
"I can drink 16 six packs!",
"aye... I'll drink any man under the table!",
"*reaches for another beer*",
"*burp*",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"I need some more budweiser",
"somebody pour me a big glass of Guinness Stout.",
"anyone ever try a wild turkey?",
"I love beer!",
}
abuse5 = {
"Where thuh ell dih althese elephamants gum frum?",
"I gneed nother dsrink! Pass it over here.",
"*Runs in the bathroom and comes back out a minute later*",
"*Takes of shirt and begins dancing on tabletop*",
"Who'll dares me to runnn owside nekked?",
"I am thirssy...",
"*takes a shot*",
"I need another cooooool one",
"I'll kick your ass [a], buy me a beer I might forgive you though!",
"gulp, gulp, gulp",
"Bartender! pour me another!",
"I can drink 16 six packs!",
"aye... I'll drink any man under the table!",
"*reaches for another beer*",
"*burp*",
"I am thirsty...",
"*takes a shot*",
"I need another cool one",
"I need some more budweiser",
"somebody pour me a big glass of Guinness Stout.",
"anyone ever try a wild turkey?",
"I love beer!",
}
abuse6 = {
"I love you guys, your my best friends, hic!",
"*SPEWW!! HORF BARFG!",
"You guyz all suuuuuck!! hehehhahaha!",
"*Falls down*",
"Gimme aznuther sdrink [a]!",
"HEY!! ummm, yooou, yah you... [a]! yah []! buy me a drink buddy!",
"Yoos guys needz jobbbs, I needz drings.",
"One more fors thee rooooood... hEHeHEHEHehHEehAAA! but comes on [a] jussss wun more!!",
}
abuse7 = {
"SNORE.....snore.....SNO-hic-RE!!",
"Hmphhmmph, smack smack, SNOOOOORE!!",
"*Rolls over*",
"*Mummbles incoherently*",
"oo...noo....stup...d..bears....ge....way....from me...nooo...",
"Snore......Snore.......SNORE!!......SNOOOORE....snortle..cough..smack smack...sigh",
"juss..one....more wo.....urt meeee.......Snore...snore",
}

--// END Drunk Phrases
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

WILDCAT

#13
that's actually where i got it from. the script posted above. all i did was change the way the commands are fired to make it easier and add nickname to THEABUSED list, but i get an error. so ?(

Syntax error: bad argument #1 to `getn' (table expected, got nil)
stack traceback:
   1:  function `getn' [C]
   2:  function `OnTimer' at line 137 [file `...0_15.25\PtokaX_0.330_15.25\scripts\DrunkBot.lua']

i can post the entire script the way i have it if it'll help someone troubleshoot my problem.

Thx :))
WILDCAT

Madman

Yes, please post the script...
line 137 is this
"I am thirsty...",

And, it is in the abuse5 table,
and, there is nothing wrong withe line in the timer...
not what i can se anyway...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

WILDCAT

#15
Thx madman.  I do see a difference in the script. maybe i didn't get it from here? but here it is anyways. i'll try the copy and paste the one above, but please tell what exactly is wrong with this one just so i know. well nevermind it looks like it's missing part of the script i think?


--// Drunk Bot
--// A Drunk and Dissorderly Bot
--// By Chaggydawg
--// Version 0.5b --First Public release, please people troubleshoot this
--// What have I got myself in for?
--// oh my god how will i do this.....


--// Variables
drunkName = "DrunkBot"  --// Drunks Name (of course coming from me what'dyou expect)
offon = 1                   --// Is Drunk Bot off or on at script start (0=off, 1=on)
AbuseInterval = 30000       --// Time Interval Between Abuse (Default 30 seconds [30000])
tolerence = (60)             --// Time to work off one drink [##*AbuseInterval] (Default 30 minutes)
sleepmumble = 900000        --// How often Drunk mumbles in their sleep (Default once every 15 minutes [900000]) (Drunk will mumble 8 times then wake up)
--// DO NOT CHANGE VARIABLES BELOW HERE!! Do so at your own risk!!!!
drinkLevel = 1              --// How Many Drinks Does Drunk Have In Him to Start (Default 1)
sleepingTime = 8           --// How Long To Sleep to be sober [#*sleepmumble] (Default 2 hours)
isSleeping = 0              --// 0=Awake  1=Asleep (Default is Awake)
tolerenceLevel = 0
sleeptemp = 0
--// DO NOT CHANGE VARIABLES ABOVE HERE!! Do so at your own risk!!!!

--// Commands
givedrink = "!givedrink"
puttosleep = "!passedout"
howmany = "!drinkcounter"
turnoff = "!drunkbotoff"
turnon = "!drunkboton"
help = "!AA"

--// Arrays
--// you can erase the other names but you should atleast leave the bartender so there are no errors
theAbused = {
"Bartender",
"*************",
"**********",
"*************",
"**********",
}

dofile("drunktriggs.txt")

--// This function is fired at the serving start
function Main()
SetTimer(AbuseInterval)
frmHub:RegBot(drunkName)
StartTimer()
end

--// This function is fired when a new data arrives
function DataArrival(curUser, Data)
s,e,inpm = strfind(Data,"($To:)")
s,e,cmd = strfind(Data,"%b<>%s(.*)")
if inpm == nil then
if cmd ~= nil then
--// removing endpipe
cmd = strsub(cmd,0,strlen(cmd)-1)
--// handling commands
if cmd == givedrink then dodrink(curUser) return 1
elseif cmd == puttosleep then dosleep(curUser) return 1
elseif cmd == howmany then dohowmany() return 1
elseif cmd == help then dohelp(curUser) return 1
elseif cmd == turnoff then dodrunkoff(curUser) return 1
elseif cmd == turnon then dodrunkon(curUser) return 1
end
end
end
end

function dohelp(curUser)
SendToNick(curUser.sName," Commands For The Drunk Bot:")
SendToNick(curUser.sName,givedrink.."      Give the Drunk a Drink")
SendToNick(curUser.sName,puttosleep.."      Slip the Drunk a Mickey")
SendToNick(curUser.sName,howmany.."   Ask how many drinks Drunk Has Had")
SendToNick(curUser.sName,turnoff.."      Turn off Drunk Bot")
SendToNick(curUser.sName,turnon.."      Turn On Drunk Bot")
SendToNick(curUser.sName,help.."      Display this Help Screen")
end

function dohowmany()
SendToAll(drunkName,"I've only had "..random(1,drinkLevel).." drinks.")
SendToAll("Bartender"," *Slips you a note that says "..drinkLevel.." drinks on it*")
end

function dodrink(curUser)
drinkLevel = (drinkLevel + 1)
SendToAll("Bartender",curUser.sName.." buys "..drunkName.." a Drink.")
SendToAll(drunkName,"Thanx "..curUser.sName.."!! I love drinks")
end

function dodrunkon(curUser)
if GetProfileName(curUser.iProfile) ~= nil then
offon = 1
end
end

function dodrunkoff(curUser)
if GetProfileName(curUser.iProfile) ~= nil then
offon = 0
end
end

function dosleep(curUser)
if isSleeping ~= 1 then
SetTimer(sleepmumble)
if curUser ~= drunkName then
SendToAll(curUser.sName, "*Slips "..drunkName.." a mickey*")
end
SendToAll(drunkName, "*Falls over on floor and passes out*")
abusephrase = gsub(abuse7[random(1,getn(abuse7))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
isSleeping = 1
end
end

function OnTimer()
if offon ~= 0 then
if isSleeping ~= 1 then
if drinkLevel > 30 then
dosleep(drunkName)
elseif drinkLevel > 20 and drinkLevel <= 30 then
abusephrase = gsub(abuse6[random(1,getn(abuse6))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 16 and drinkLevel <= 20 then
abusephrase = gsub(abuse5[random(1,getn(abuse5))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 12 and drinkLevel <= 16 then
abusephrase = gsub(abuse4[random(1,getn(abuse4))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 8 and drinkLevel <= 12 then
abusephrase = gsub(abuse3[random(1,getn(abuse3))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 4 and drinkLevel <= 8 then
abusephrase = gsub(abuse2[random(1,getn(abuse2))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
elseif drinkLevel > 0 and drinkLevel <= 4 then
abusephrase = gsub(abuse1[random(1,getn(abuse1))], "%b[]", theAbused[random(1,getn(theAbused))])
SendToAll(drunkName,abusephrase)
end
end
end
--// Drinks wearing off after time
if offon == 1 then
tolerenceLevel = tolerenceLevel + 1
if tolerenceLevel >= tolerence then
tolerenceLevel = 0
if drinkLevel > 1 then
drinkLevel = drinkLevel - 1
end
end
end
--// Sleeping timer action
if offon == 1 then
if isSleeping == 1 then
sleeptemp = sleeptemp + 1
SendToAll(drunkName, sleeptemp)
if sleeptemp < sleepingTime then
SendToAll(drunkName,abuse7[random(1,getn(abuse7))])
elseif sleeptemp >= sleepingTime then
isSleeping = 0
SendToAll(drunkName,"*Yawn* I feel so Refreshed!! *Cracks open a Beer*")
SendToAll(drunkName,"*Drinks down the Beer* Alrighty, Who's got another beer for me?")
drinkLevel = 1
SetTimer(AbuseInterval)
end
end
end
end


--// Add remove user logging in/out

--// This function is fired when a new user finishes the login
function NewUserConnected(curUser)
AddUser(theAbused,curUser)
end


--// This function is fired when an operator enters the hub
function OpConnected(curUser)
AddUser(theAbused,curUser)
end

--// This function is fired when an user disconnects
function UserDisconnected(curUser)
RemoveUser(theAbused,curUser)
end

--// This function is fired when an operator disconnects
function OpDisconnected(curUser)
RemoveUser(theAbused,curUser)
end


--//
--// RabidWombat's binarysearch function (I am so confused I hope it works)
--// With not-very-Modified Bonki add/remove user Script
--//

function RemoveUser(tTable, uUser)
local iFind = BinarySearch(tTable, uUser.sName);

if(iFind ~= -1) then
tremove(tTable, iFind);
return 1;
else
return 0;
end;
end

function AddUser(tTable, uUser)
local iFind, iInsert = BinarySearch(tTable, uUser.sName);

if(iFind == -1) then
tinsert(tTable, iInsert, uUser.sName);
return 1;
else
return 0;
end;
end

function BinarySearch(tTable, SearchVar)
   assert(tTable and SearchVar);

   local iBot, iMid, iTop = 1, nil, getn(tTable);
   local CompVal = nil;

   if(getn(tTable) == 0) then return -1, 1; end

   while(iBot <= iTop) do
      iMid = floor((iTop + iBot) / 2);

      CompVal = tTable[iMid];

      if(CompVal == nil) then return -1, -1; end

      if(SearchVar < CompVal) then
         iTop = iMid - 1;
      elseif(SearchVar > CompVal) then
         iBot = iMid + 1;
      else
         return iMid, -1;
      end
   end

   if(SearchVar > CompVal) then
      iMid = iMid + 1;
   end

   return -1, iMid;
end

Madman

Right, now the line 137 is
abusephrase = gsub(abuse1[random(1,getn(abuse1))], "%b[]", theAbused[random(1,getn(theAbused))])
And, yes and no... it do and do not miss any part..

In your script you have
dofile("drunktriggs.txt")
but in the script posted here they have this....
-// Abuse Arrays - The things drunks says at certain levels of drunkeness 
abuse1 = { 
"I'm Not Drunk at all. Hey [ABUSED] Buy Me a Drink!!", 
"Hey [a] Are we gonna start Drinking or what?", 
"Who in here can buy me a drink?", 
"Oh man, I really need another beer!", 
"Who do I have to screw to get a drink around here?", 
"Come on someone buy me a drink, you got any money [a]?", 
"*takes big drink*", 
}
and so on...

So.... The solutions...
To use the first script just copy it to a lua file...

To use the script u pasted... read my first post.....

u have to create a file called drunktriggs.txt and paste all the tabels i posted in my first post in this thread....

if you still get errors.. i'll take closer look on the code... just noticed the dofile in your code.. so i didnt bother to check more... =)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

WILDCAT

#17
thx madman

i just copied and pasted the one above and everything worked just fine. my apologize for the trouble.


WILDCAT  :D

Madman

We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

SMF spam blocked by CleanTalk