Convert lua4 to lua5
 

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

Convert lua4 to lua5

Started by Genius, 05 May, 2005, 22:13:12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Genius

Hi evryone

I need convert this script Please
Sory about my inglish



--------------------------

-- TrickerBot2.lua, created by Ptaczek Dec-24, 2002
-- Just see how to implement the NMDC TriggerBot in LUA :)

-- changes
-- Feb-24, 2003, v2.0 Modification for DataArrival return value.
-- Tiny changes of VidFamne with lot of help of Piglja
-- Added Timer by piglja - 20.03.03

botname = "TrickerBot"
trigs = {
      lol="Yeah, that was funny [USER]. Haha.",
      bye="See ya [USER]",
      ptokax="Oh Yeah, PtokaX ;)",
      fuck="Watch IT [USER]! One more line of code and i could kick your ass!",
      ["shut up"]="Make me!"
   }


       lol={
  "Yeah, that was funny,  Hahahaha.",
  "Hmm, ok that was funny, I think :)",
  "what! [CURUSER]  why are you laughing?",
  "You shake when you laugh, like a bowl full of jelly",
  "hilarious!",
  "hehehehe",
  "hohohohoh"
 
                              }
      bye={
    "See ya, [CURUSER]",
    "Bye, [CURUSER]   .....*sniff*",
    "Hey,  [CURUSER] get your ass back here. Hehe just kidding, if U have to go U have to go, Bye",
    "*snif* we will miss you, [CURUSER]!",
    "*waves bye*",
    "Leaving already?!",
    "Got better things to do, huh?",
    "Go on...leave!"
                                        }
      
      fuck={
    "Watch IT [CURUSER]!! One more line of code and i could kick your ass!",
    "I hate it when you talk like that!",
    "Don't ever insult me again",
    "That's not a very nice way to talk !",
    "Keep it up and I will kick you!",
    "Say that again and I am going to clobber you!"
                                  }
      shut={
     "Make me!",
     "Ooh! I'm wounded!",
     "I'll shut up when I damn well please",
     "blah blah blah!",
     "Why should I?"
                            }
      
             

function Main()
   frmHub:RegBot(botname)
end


function DataArrival(curUser, data)
   if( strsub(data, 1, 1) == "<" ) then
      -- get the msg only using regular expression
      s,e,msg = strfind(data, "%b<> ([ -z]*)")

      -- look in the table
      for key, value in trigs do
                        if( strfind( strlower(msg), key) ) then
            if (key=="lol") then
            answer = lol[random(1,getn(lol))]
            SetTimer(500)
            StartTimer()
            break
            end
            if (key=="bye") then
            answer = bye[random(1,getn(lol))]
            SetTimer(500)
            StartTimer()
            break
            end
            if (key=="fuck") then
            answer = fuck[random(1,getn(lol))]
            SetTimer(500)
            StartTimer()
            break
            end
            if (key=="shut up") then
            answer = shut[random(1,getn(lol))]
            SetTimer(500)
            StartTimer()
            break
            else
            answer, x = gsub(value, "%b[]", curUser.sName)
            SetTimer(500)
            StartTimer()
         end
      end
   end
end
end


function OnTimer()
SendToAll(botname, answer )
StopTimer()
end

[][] Genius

jiten

Search the forum for "sensi", "janinha" and "trickerbot".
You'll find Lua 5 versions of those.

Cheers

Genius


jiten


SMF spam blocked by CleanTalk