PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: ((UKSN))shad_dow on 23 July, 2004, 17:24:50

Title: can some body give me a few hints plz
Post by: ((UKSN))shad_dow on 23 July, 2004, 17:24:50
lo all

right here goes ,

can sombody give me a few hints/tips on
how i can do this

user types !add therapyuk 1

addys { "sytes.net" = 1 , "no-ip.com"= 2, }

when another user tpes !view

bot rsponces with

nick added therapyuk.sytes.net

any help would be appeciated

yours
shad
Title:
Post by: plop on 23 July, 2004, 17:42:23
add a 2nd table.
tTable = { ["therapyuk"] = "((UKSN))shad_dow" }
for a,b in tTable do
   print(a.." added by: "..b)
end

plop
Title:
Post by: ((UKSN))shad_dow on 23 July, 2004, 17:51:01
cheers plop
Title:
Post by: ??????Hawk?????? on 23 July, 2004, 17:58:54
hi m8  maby  something like this  ???


addys {
 "sytes.net" ,
 "no-ip.com",
 }
FullAddys{}

!add therepy- 1    <-------- command in chat

_,_,prefix , command, text, action   <----------  your  strfind

FullAddys[text..addys[action]] = 1
Title:
Post by: ((UKSN))shad_dow on 23 July, 2004, 20:54:18
cheers hawk andplop but i manged to do it diffent way ,

still to add save function

--// Addy-Test by shad_dow
--// help by plop and hawk


Bot = "addy-test"


tAddys = {
[1]="styes.net",
[2]="no-ip.com",
[3]="beer.net"
}



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 == "!add")   then
doaddy(user,data)
return 1
                                   
end
end
end


function doaddy(user,data)
local s,e,cmd,hub,unit = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(%d+)" )
--local usr = GetItemByName(usr)
if hub == nil and unit == nil then
user:SendData(Bot,"Syntex is !add [hub name] [reason] ")
else
local add = tAddys[tonumber(unit)]
                if add == nil then
                                    user:SendData(Bot,"addy not found")

else
SendToAll(Bot, "User "..user.sName.." added "..hub.."."..add.."")


end
end
end

yours shad