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
add a 2nd table.
tTable = { ["therapyuk"] = "((UKSN))shad_dow" }
for a,b in tTable do
print(a.." added by: "..b)
end
plop
cheers plop
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
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