PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: Cp6uja on 07 June, 2004, 11:07:10

Title: >>InfoBot<<
Post by: Cp6uja on 07 June, 2004, 11:07:10
--// Made by.... Deftonzs v.01 & small fix from Cp6uja

botname = "Info-Bot2"

function Main()
   frmHub:RegBot(botname)
end

function DataArrival(user, data)

   if(strsub(data, 1, 4) == "$To:") then

      -- remove end pipe
      data=strsub(data,1,strlen(data)-1)

      -- is this meant for our bot?
      s,e,whoTo = strfind(data,"$To:%s+(%S+)")

      if (whoTo == botname) then

         s,e,whoTo,from,cmd = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)")

         

         if (cmd=="+info") then
                                  user:SendPM(botname," ")
                                  user:SendPM(botname,"You are currently connected to"..frmHub:GetHubName())
                                  user:SendPM(botname," ")
                                  user:SendPM(botname,"The actual number of users connected -bots/ops is: "..frmHub:GetUsersCount())
                                  user:SendPM(botname,"The actual number of users that we can hold is: "..frmHub:GetMaxUsers())
                                  user:SendPM(botname,"The current description of the hub is: "..frmHub:GetHubDescr())
                                  user:SendPM(botname,"Is redirect all on? 1 for yes; 0 for no: "..frmHub:GetRedirectAll())
                                  user:SendPM(botname,"Is redirect when full on? 1 for yes; 0 for no: "..frmHub:GetRedirectFull())
                                  user:SendPM(botname,"The current redirect address we use is: "..frmHub:GetRedirectAddress())
                                  user:SendPM(botname,"The current dns we use to register our hub is: "..frmHub:GetRegServer())
                                  user:SendPM(botname," ")
                                  user:SendPM(botname,"You are currently connected to"..frmHub:GetHubName())
                                  user:SendPM(botname," ")                    
         end

         
      end
   end
end

--// Yay-Horray For Deftonzs
--// I will add more stuff as it will become avalible.
--// Made by.... Deftonzs v.01