PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: night_hawk on 12 February, 2004, 00:38:46

Title: I would like a bar bot!!!
Post by: night_hawk on 12 February, 2004, 00:38:46
Hi i would lik eto know if some one can change this neo script to a lua.file for me I am changing hub and my users like it.

_____________________________________________

' Edited from the good old trigger bot by Snooze -> Snooze.no-ip.com Snooze's Keep


Dim iTrigger
Dim aTriggers(22,3)
Dim sBotName
sub Main()      
   aTriggers(0,0) = "bartender"
   aTriggers(0,1) = "Yes %USER% - What can i get you Sir"
   aTriggers(1,0) = "Beer"
   aTriggers(1,1) = "One beer comming up %USER% !"
   aTriggers(2,0) = "coffee"
   aTriggers(2,1) = "Are you sure you don't want anything stronger %USER% ??"
   aTriggers(3,0) = "Vodka"
   aTriggers(3,1) = "Yes %USER%! Ill bring that Vodka right over !"
   aTriggers(4,0) = "check"
   aTriggers(4,1) = "It's on the house %USER% !"
   aTriggers(5,0) = "menu"
   aTriggers(5,1) = "I serv Sex On The Beach, Long Island Ice Tea, Fuzzy Navel, Screaming Orgasm, Triple Orgasm, Southern Comfort, Jack Daniels, Monepulciano, Cortese, Sake, Jenever, Beer, Vodka , Pisco,, Icetee, Black Russian, Harvie Wallbanger, Rum, Coke"
   aTriggers(6,0) = "Icetea"
   aTriggers(6,1) = "Icetea comming up Sir !"
   aTriggers(7,0) = "Black Russian"
   aTriggers(7,1) = "Sorry Sir. We have no Russian's on the staff !"   
   aTriggers(8,0) = "Harvie Wallbanger"
   aTriggers(8,1) = "Yes %USER% ! One Harvie Wallbanger comming your way !"
   aTriggers(9,0) = "Coke"
   aTriggers(9,1) = "I guess u will be driving tonight %USER% :0)"
   aTriggers(10,0) = "Rum"
   aTriggers(10,1) = "Comming up %USER% ! And one for your lady friend to Sir ?"
   aTriggers(11,0) = "Pisco"
   aTriggers(11,1) = "One Pisco coming up  %USER% ! Anything else sir ?"
   aTriggers(12,0) = "Monepulciano"
   aTriggers(12,1) = "Yes %USER% ! One for your friend sir?"
   aTriggers(13,0) = "Cortese"
   aTriggers(13,1) = "Right away %USER% ! I will bring it right to you sir"
   aTriggers(14,0) = "Jenever"
   aTriggers(14,1) = "Jenever on the way %USER% ! Any other drinks Sir?"
   aTriggers(15,0) = "sake"
   aTriggers(15,1) = "Yes sure %USER%! One for the your frined?"
   aTriggers(16,0) = "Screaming Orgasm"
   aTriggers(16,1) = "Yes %USER%! One screaming orgasm coming up you want my numder too?"
   aTriggers(17,0) = "Jack Daniels"
   aTriggers(17,1) = "Yes %USER%!  One shot coming up!"
   aTriggers(18,0) = "Southern Comfort"
   aTriggers(18,1) = "Yes %USER%!  Right away! But you know i can Comfort you."
   aTriggers(19,0) = "Triple Orgasm"
   aTriggers(19,1) = "Yes %USER%!  Right away! May I help in any way?"
   aTriggers(20,0) = "Fuzzy Navel"
   aTriggers(20,1) = "Yes %USER%!  Right away! One Fuzzy coming at you!"
   aTriggers(21,0) = "Long Island Ice Tea"
   aTriggers(21,1) = "Yes %USER%!  You like one for your girlfriend to sir?"
   aTriggers(22,0) = "Sex On The Beach"
   aTriggers(22,1) = "Right away %USER%!  But sex in a bed is much better"
iTrigger = 22
   sBotName = "Roger"
end sub

Sub DataArival (curUser, sCurData) 'This event is fired when a user sends data to the hub. curUser is a DCUser object and sCurData is the data they sent.
   Dim x 'This is a counter variable
   Dim sFrom
   If left(sCurdata,1)="<" then 'Message is chat
      for x = 0 to iTrigger
         If instr(1, lcase(sCurData), lcase(aTriggers(x,0)))>0 then
            colUsers.SendChatToAll cstr(sBotName), ReplaceVars(aTriggers(x,1),sCurData)
            exit for
         End If
      next
   End If
End Sub

sub NewUserConnected (curUser) 'This event is fired when a new user logs in.
   curUser.PrivateMessage cstr(sBotName), "Hello " & curUser.sName & ". Welcomd to " & frmHub.txtName.text
end sub

Function BeforeFirst(sIn, sFirst) 'These are helper functions and do what their names imply
    BeforeFirst = Left(sIn, InStr(1, sIn, sFirst) - 1)
End Function

Function AfterFirst(sIn, sFirst)
    AfterFirst = Right(sIn, Len(sIn) - InStr(1, sIn, sFirst) - (Len(sFirst) - 1))
End Function

Function isCommand(sData)
   isCommand = (Left(sData,1)="$")
End Function

Public Function AfterLast(sFrom, sAfterLast)
    If InStr(1, sFrom, sAfterLast) Then
        AfterLast = Right(sFrom, Len(sFrom) - InStrRev(sFrom, sAfterLast) - (Len(sAfterLast) - 1))
    Else
        AfterLast = ""
    End If
End Function

Public Function sReplace(sIn, sWhat, sWith)
   sReplace = sIn
   Do while instr(1,sReplace,sWhat) <> 0
      sReplace = BeforeFirst(sReplace,sWhat) & sWith & AfterFirst(sReplace,sWhat)
   loop
End Function

Public Function ReplaceVars(sMessage, sCurData)
   dim sUser
   dim sText
   sText = AfterFirst(sCurData,"> ")
   sUser = BeforeFirst(AfterFirst(sCurData,"<"),">")
   ReplaceVars = sMessage
   ReplaceVars = sReplace(ReplaceVars, "%USER%", sUser)
   ReplaceVars = sReplace(ReplaceVars, "%ECHO_TEXT%", sText)
End Function


_____________________________________________

File is call bartender

If some one can do it for me i would be very happy ty :]
Title:
Post by: pHaTTy on 12 February, 2004, 00:42:05
already one around i think check the script archive hosted by optimus
Title: hey
Post by: night_hawk on 12 February, 2004, 00:54:00
Where is that i need to look i am still new here
Title:
Post by: pHaTTy on 12 February, 2004, 00:56:34
look on main page and there is a big white link just up aove the forums below new registered users
Title:
Post by: night_hawk on 12 February, 2004, 01:12:47
I did not see any X(
Title:
Post by: Snooze on 27 February, 2004, 22:30:16
heheh - kinda fun to see that the "Bartender" is still alive
Title:
Post by: toolmanwill on 29 February, 2004, 15:49:41
def....someone please convert this script!!!!
i used to run nmdc also and my users totally LOVED that script!!!!!
Title:
Post by: night_hawk on 29 February, 2004, 15:54:57
i do not think anyone knows how
Title:
Post by: plop on 07 March, 2004, 22:03:37
here is the script archive. (http://ptokaxscriptsection.no-ip.org/)

plop
Title:
Post by: G?M on 13 March, 2004, 03:25:48
This is my first attempt at a LUA Script
Enjoy!


Edit: Fixed a syntax error.

--Bartender by G?M?
--Based upon (uk-kingdom)pH?tt?'s Tutorials on the LUA Board


Bot = "Bartender"
prefix = "!"

function Main()
--frmHub:RegBot(Bot) -- Un-comment to show in hub
end

function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
        ------------------
        -- Barkeep    --
        ------------------
if cmd == prefix.."barkeep" then
SendToAll(Bot,"What can I get you "..user.sName.." ?")
            user:SendData(Bot,"If you need Help just Type !barhelp")
return 0
        ------------------
        -- Help         --
        ------------------
        elseif cmd == prefix.."barhelp"  then
            user:SendData(Bot,"Bartender Commands:")
                        user:SendData(Bot,"!spirits       -Shows the Spirits Menu")
            user:SendData(Bot,"!beer          -Shows the Beer Menu")
            user:SendData(Bot,"!mixed       -Shows the Mixed Drinks Menu")
            return 1
        -------------------
        -- Spirits       --
        -------------------
        elseif cmd == prefix.."spirits" then
             user:SendData(Bot,"I have: Jack Daniels, Bacardi, Jose Cuervo, Baliey's, Everclear, Captain Morgan's, Appleton's, Jagermeister, and Muscadine Wine.")
             return 1
        elseif cmd == prefix.."rum" then
            SendToAll(Bot,"Wooooo going for the good stuff eh "..user.sName.."? One Rum Coming Up!")
        return 0
        elseif cmd == prefix.."appletons" then
            SendToAll(Bot,"Sure "..user.sName.." One Appleton's on the Way!")
        return 0
        elseif cmd == prefix.."captain" then
            SendToAll(Bot,"Aye great choice "..user.sName.." Captain Morgan is the nectar of the Gods.")
            return 0
        elseif cmd == prefix.."jd" then
            SendToAll(Bot,"Nothing like a good big Swig of Jack Daniel's eh "..user.sName.."?")
            return 0
        elseif cmd == prefix.."bacardi" then
            SendToAll(Bot,"Ahhhh good choice "..user.sName.."!")
            return 0
        elseif cmd == prefix.."cuervo" then
            SendToAll(Bot,"WOOHOOO TEQUILA!!!, coming right up "..user.sName.."!")
            return 0
        elseif cmd == prefix.."baileys" then
            SendToAll(Bot,"Aye Bailey's is a sweet sweet nectar yes?")
            return 0
        elseif cmd == prefix.."everclear" then
            SendToAll(Bot,"WOOO one ROT GUT Coming UP "..user.sName.."!")
            return 0
        elseif cmd == prefix.."jager" then
            SendToAll(Bot,"One Jagermeister right away"..user.sName.."!")
            return 0
        elseif cmd == prefix.."wine" then
            SendToAll(Bot,"Did you know this wine was bought just for me"..user.sName.." ?")
            return 0
        -------------------
        --Mixed Drinks   --
        -------------------
        elseif cmd == prefix.."mixed" then
            user:SendData(Bot,"I can make the following drinks: Margarita, Sex On The Beach, Long Island Iced Tea, Fuzzy Navel, Buttery Nipple, Blowjob, Mudslide, and a Martini.")
            return 1
        elseif cmd == prefix.."blowjob" then
            SendToAll(Bot,"Sorry I can't help you with that "..user.sName.." Perhaps you should talk to [ASDL]Janine, OH! you meant the mixed drink!.... sure coming right up!")
            return 0
        elseif cmd == prefix.."sexonthebeach" then
            SendToAll(Bot,"One Sex On the Beach, do you have anyone to share it with "..user.sName.."?  ;)")
            return 0
        elseif cmd == prefix.."margarita" then
            SendToAll(Bot,"Margaritaville la la OH sorry!, "..user.sName.." coming right up!")
            return 0
        elseif cmd == prefix.."longisland" then
            SendToAll(Bot,"One Long Island Iced Tea, Anything else "..user.sName.."?")
            return 0
        elseif cmd == prefix.."fuzzynavel" then
            SendToAll(Bot,"Sure Thing "..user.sName.."! One Fuzzy Navel right away")
            return 0
        elseif cmd == prefix.."butterynipple" then
            SendToAll(Bot,"One Buttery Nipple coming up "..user.sName.."!")
            return 0
        elseif cmd == prefix.."mudslide" then
            SendToAll(Bot,"mmmm I like those myself "..user.sName.." I'll make it with extra Chocolate for ya ;)")
            return 0
        elseif cmd == prefix.."martini" then
            SendToAll(Bot,"Sure "..user.sName.." One Martini Shaken Not Stirred ;)")
            return 0
        -------------------
        -- Beers         --
        -------------------
        elseif cmd == prefix.."beer" then
            user:SendData(Bot,"I have: MGD, High Life, Bud, Budlight. Rolling Rock, Bass Ale, Killians, Guiness, Murphy's Stout, Fosters, Zima, and Smirnoff Ice.  What will it be "..user.sName.."?")
            return 1
        elseif cmd == prefix.."mgd" then
   SendToAll(Bot,"Sure "..user.sName.." One Miller Genuine Draft anything else?")
       return 0
        elseif cmd == prefix.."highlife" then
   SendToAll(Bot,"Ok one Miller HighLife "..user.sName.." Anything Else?")
       return 0
       elseif cmd == prefix.."bud" then
   SendToAll(Bot,"Budweiser Good Choice "..user.sName)
       return 0
       elseif cmd == prefix.."budlight" then
   SendToAll(Bot,"One Bud Light "..user.sName.." Anything Else?")
       return 0
       elseif cmd == prefix.."rollingrock" then
   SendToAll(Bot,"One Rolling Rock "..user.sName.." Anything Else?")
       return 0
   elseif cmd == prefix.."bassale" then
   SendToAll(Bot,"One Bass Ale "..user.sName.." Anything Else?")
       return 0
        elseif cmd == prefix.."killians" then
   SendToAll(Bot,"One Killian's Irish Red "..user.sName.." Anything Else?")
       return 0
       elseif cmd == prefix.."guinness" then
   SendToAll(Bot,"One Guinness Draught "..user.sName.." Anything Else?")
       return 0
       elseif cmd == prefix.."murphys" then
   SendToAll(Bot,"One Murphy's Stout "..user.sName.." Anything Else?")
       return 0
       elseif cmd == prefix.."fosters" then
   SendToAll(Bot,"One Foster's "..user.sName.." Anything Else?")
       return 0
       elseif cmd == prefix.."zima" then
     SendToAll(Bot,"One Fruity FOO FOO oh... I mean ZIMA Coming up!")
       return 0
      elseif cmd == prefix.."smirnoffice" then
   SendToAll(Bot,"One Smirnoff ICE "..user.sName.." Anything Else?")
       return 0
                           end
              end
end