Help with Drunkbot
 

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

Help with Drunkbot

Started by Gnuff?, 25 October, 2003, 19:27:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gnuff?

Can anyone please helt me with this script?

It does not show the massages in the drunkbot.txt.

It's only possible to give a drink, see how many drinks it have got and give it a "mickey"

It's suposed to say a massage every 15 mins. but nothing happens.. :(

The script:

--// Drunk Bot
--// A Drunk and Dissorderly Bot
--// By Chaggydawg
--// Version 0.5a --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 = 0                   --// Is Drunk Bot off or on at script start (0=off, 1=on)
AbuseInterval = 600000       --// 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",
}


--// This function is fired at the serving start
function Main()
SetTimer(AbuseInterval)
StartTimer()
end
dofile("drunktalk.txt")


--// 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)
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
SendToAll("Bartender","The Bar is Open")
frmHub:RegBot(drunkName)
end
end

function dodrunkoff(curUser)
if GetProfileName(curUser.iProfile) ~= nil then
offon = 0
SendToAll("Bartender","Last Call!!")
frmHub:UnregBot(drunkName)
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
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


The txt. file:

--// 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

Can anyone please help me??

Gnuff :)
Gnuff

chaggydawg

well this post is like way late, maybe you figured it out already or just gave up lol.   but have you tried turning the bot on?

SMF spam blocked by CleanTalk