PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: Dr-Pepper on 02 November, 2005, 22:22:59

Title: Fire the Dude
Post by: Dr-Pepper on 02 November, 2005, 22:22:59
Hello there again..

In my hub is running drunkbot (a pretty anoying version) and this script:

[PeP 22:07:05] rusian = {
["sBotName"] ="DA-Dude",
["prefix"] = "+",
["cmd"] = "fire",
["maxmessages"] = 10,     -- kansberekening voor raak of mis
["discortimeban"] = "1", -- zet 1 voor disconect en zet op 2 voor tijdban
["timebantime"] = "2", -- Tijd ban tijd staat in minuten
["permissions"] = {[-1] = 1, [0] = 1, [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, }, -- 1 = allowed and 0 = not allowed
}

function Main()
frmHub:RegBot(rusian["sBotName"])
end

function ChatArrival(user, data)
data = string.sub(data,1,string.len(data)-1)
s,e,cmd = string.find(data, "%b<>%s+(%S+)")
if cmd == ""..rusian["prefix"]..""..rusian["cmd"].."" then
if rusian["permissions"][user.iProfile] == 1 then
fire(user, data)
else
user:SendData(rusian["sBotName"], "You are not allowed to use this command!")
end
return 1
end
end

function fire(curUser, sData)
messages = {
[1] = "Haaaaaaaaaahaaaaa " ..curUser.sName.. ", You can't kill dude dude!",
[2] = "\r\n ___________________________] \\ l /\r\n \\__////_(____)_______________0 ------BANG ------>\r\n ) @ ___9mm___________\\_/ / l \\\r\n / //\r\n / (?X?) //\r\n / //\r\n / _____//\r\n\r\n\t" ..curUser.sName.." You killed The son of GOD!! \r\n\ You killed Bartender's only customer, GET OUT OF HERE! \r\n", -- message on shoot
[3] = "*Reaches another beer* "..curUser.sName..", Hey.... I saw a bullet flying...",
[4] = "*Jumps over the bar*",
[5] = "*Kletch* " .. curUser.sName.." You hit my beer!!",
[6] = "You're shooting drunk "  ..curUser.sName..", gimme a drink!",
[7] = "Whaaaaa " ..curUser.sName.. ", Hey.... there bullets flying in here!",
[8] = "You wanna shoot the son of GOD " ..curUser.sName.."????",
                         [9] = "It's time to kick ass and chew bubble gum.. " ..curUser.sName.. ".. And soon you'll be gone!",
                         [10] = "Damn I'm good",

                         }

local Fire = math.random(1, rusian["maxmessages"])
if Fire == 2 then
SendToAll(rusian["sBotName"], messages[Fire])
SendPmToNick(curUser.sName, rusian["sBotName"], "Je bent eraan!" ..messages[Fire])  
if rusian["discortimeban"] == "1" then
curUser:Disconnect()
elseif rusian["discortimeban"] == "2" then
if curUser.bOperator == 1 then
curUser:Disconnect()
else
SendPmToNick(curUser.sName, rusian["sBotName"], "Je heb een tijdban gekregen van/You received a Time ban of "..rusian["timebantime"].." minutes, Try Again")
curUser:TimeBan(rusian["timebantime"])
end
end
else
SendToAll(rusian["sBotName"], messages[Fire])
end
end


And I've got an idea for it what I can't make myself. If users fire the roulette they only could kill themselves. Is it possible that a function is added that stopts the drunkbot script? So you have the options: misses a shot, get killed or kill the dude?

Hope it can be done :)
Title:
Post by: Madman on 03 November, 2005, 06:14:04
This drunkbot you are useing... I guess it's the one found here (http://board.univ-angers.fr/thread.php?threadid=3748&boardid=26&sid=5ffcc9ed02d8c0abdd6c0916c1ecaf10)....

If so.. I have a mod for you later 2 day...
now i'm of to bed...
Title:
Post by: Dr-Pepper on 03 November, 2005, 16:46:44
Yep that's the one, a littlebit modded by myself :)
Title:
Post by: Madman on 03 November, 2005, 23:14:55
Okey.. Well..
I belive this is what you wanted...
I rewrote the entire code.. thought it needed a cleen up... ;p

So you need to mod it again.. =)

DrunkBot.3.0.Fire.Mod (http://www.thedestruction.org/filer/lua/lua5/DrunkBot.3.0.Fire.Mod.rar)
Title:
Post by: Dr-Pepper on 04 November, 2005, 00:42:53
It's just great! Thanks for the good work :D.

Will teach him some annoying things soon :P my users seems to love him a bit now

Keep it up!
Title:
Post by: Madman on 04 November, 2005, 02:04:57
QuoteOriginally posted by Dr-Pepper
It's just great! Thanks for the good work :D.

Np, alwasy happy to work on Dude... =) After all, he was the one who thought me lua... lol
Title:
Post by: Dr-Pepper on 08 November, 2005, 17:21:29
Now another question about the Dude.. I've got some more annoying scripts running by name of Dude.. Is it possible that a fire in roulette (Roulette like I posted in my first message) can stop one or more other scripts..  Like the command !stopscript hik.lua ?

In that case I could go further making Dude a real gentleman :)
Title:
Post by: Madman on 09 November, 2005, 02:24:24
No I don't think so.. there is nothing like StopScript in lua..
Title:
Post by: Dr-Pepper on 09 November, 2005, 12:43:04
Allright then.. Thanks anyway :)