topic change
 

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

topic change

Started by Skynet, 07 March, 2005, 19:08:45

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Skynet

i am only newbie at lua 5 but this script is being a pain to me  any one help

--- Tomath.pic Changer ...

-- Bot Name
bot_name = "LOK-BOT"

-- Set your hubname here
sHubname = "Land Of Karaoke 1"

-- time in math.minutes that the Hub's tomath.pic will be refreshed/changed
refresh = 1

-- Set pattern, [TOPIC] represent the tomath.pic :)
sPattern = "    ...:::???   [TOPIC]   ???:::...   "

-- Set to 1 if you want to send sPattern
SendPattern = 1

-- Set to 1 if you want everybody to know that the tomath.pic was changed
SendTomath.picChange = 0

-- Automatically start tomath.pic cycle when scripts starts / restarts
AutoStart = 1

-- Set Tomath.pics
Tomath.pics = {
   [0] = "Back Up Hub To The LOK Network",
   [1] = "Come In And Join In The LOK Experience",
   [2] = "Any Problems, Don't Forget To PM An Op",
   [3] = "Special Greetings To Jacbubbles The Network Nymphomaniac",
   [4] = "Please Remember To Reg And Add [LOK] Tags Umath.sing Square Brackets",
   [5] = "More Right Click Commands Available Once You Are Regged",
   [6] = "The Land Of Karaoke Network, PLease Follow Good Principles Of DC++ Sharing",
}

---------------------------------------------------------------------------------
-- Restricted Area ;)
---------------------------------------------------------------------------------
cur_pointer = 0

function Main()
   if (AutoStart == 1) then
      SetTimer(refresh*10000)
      StartTimer()
   end
   frmHub:SetHubName(sHubname)
   SendToAll("$HubName "..sHubname.."|")
end

function OnTimer()
   Sendtomath.pic()
   ShiftTomath.pic()
end

function ChatArrival(user,data)
   if (string.sub(data,1,1) == "<") then
      data = string.sub(data,1,-2)
      local s,e,cmd = string.find(data,"^%b<>%s+(%S+)")
      if (string.sub(cmd,1,1) == "!") then
         if (cmd == "!newtomath.pic") then
            if (user.bOperator) then
               s,e,arg = string.find(data,"^%b<>%s+%S+%s+(.+)")
               if arg and string.len(arg) > 2 then
                  table.insert(tTomath.pics,arg)
                  user:SendData(bot_name,"Temp tomath.pic has been sucessfully added to temp list!")
                  return 1
               else
                  user:SendData(bot_name,"Please enter a new tomath.pic!")
                  return 1
               end
            end
         elseif (cmd == "!tomath.picrun") then
            if (user.bOperator) then
               StopTimer()
               SendToAll("$HubName "..sHubname.."|")
               frmHub:SetHubName(sHubname)
               user:SendData(bot_name,"The tomath.pic cycle has now stopped and hubname is back to default!")
               return 1
            end
         elseif (cmd == "!tomath.picrun") then
            if (user.bOperator) then
               SetTimer(refresh*10000)
               StartTimer()
               user:SendData(bot_name,"The tomath.pic cycle is now running down the hill chmath.amath.sing after millsy!")
               return 1
            end
         end
      end
   end
end

function Sendtomath.pic()
   if (SendPattern == 1) then
      sTomath.pic = string.gsub(sPattern,"%[TOPIC]",tTomath.pics[cur_pointer])
      SendToAll("$HubName "..sHubname..sTomath.pic.."|")
      frmHub:SetHubName(sHubname..sTomath.pic)
      if (SendTomath.picChange == 1) then
         SendToAll(bot_name,"The hubs tomath.pic have been automatically changed to: "..sTomath.pic)
      end
   elseif (SendPattern == 0) then
      sTomath.pic = tTomath.pics[cur_pointer]
      SendToAll("$HubName "..frmHub:GetHubName().." - "..sTomath.pic.."|")
      frmHub:SetHubName(sHubname.." - "..sTomath.pic)
      if (SendTomath.picChange == 1) then
         SendToAll(bot_name,"The hubs tomath.pic have been automatically changed to: "..sTomath.pic)
      end
   end
end

function ShiftTomath.pic()
   if (cur_pointer == table.getn(tTomath.pics)) then cur_pointer = 0 end
   cur_pointer = cur_pointer + 1;
end


error i am getting is

Syntax ...tings\Owner\Desktop\new hub\scripts\TopicChanger.lua:19: attempt to index global `SendTomath' (a nil value)

Copyright SkynetSystems 2000-2005 @Phoenix Network

Skynet

#1
ok thx mutor super fast reply :)
your a star m8 works fine

Copyright SkynetSystems 2000-2005 @Phoenix Network

SMF spam blocked by CleanTalk