PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: EXNET OWNER on 22 December, 2004, 17:25:17

Title: simple script please
Post by: EXNET OWNER on 22 December, 2004, 17:25:17
i need a simple script that basically you put in a command i.e.

!best

and it sez in the hub EXILE is the best

something like that

please :D
Title:
Post by: ((UKSN))shad_dow on 22 December, 2004, 19:56:34
hi try this


-//the best created by shad
-//requseted by EXNET OWNER



Bot = "The_Best"


function DataArrival(user,data)

  if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")

          if cmd =="!best" then
             dobest(user,data)
            return 1

          end

   end

end


function GetArgs1(data)
local _,_, arg1 = strfind(data,"%s+%S+%s+(.+)")
return arg1
end



function dobest(user,data)
arg = GetArgs1(data)
if arg ~= nil then
SendToAll(Bot,"User "..arg.." is the best" )
else
user:SendData(Bot,"Cmdet is !best [username] ")
end
end


yours shad