small ascii script tested and working
-- ascii main sender
--
-- LUA 5
--03/02/05
Bot = "LOK" -- your main bot here
CDFolder = "images" -- make folder in your scripts put your ascii there
function Main()
frmHub:RegBot(Bot)
end
function ChatArrival(user, data)
data=string.sub(data,1,string.len(data)-1)
if( string.sub(data, 1, 1) == "<" ) then
s,e,cmd = string.find(data,"%b<>%s+(%S+)")
cmd = string.sub(cmd, 1,string.len(cmd))
if io.open(CDFolder.."/"..cmd..".txt",r) ~= nil then
showtext(user, cmd)
return 1
end
end
end
function showtext(user, file)
local contents ="\r\n\r\n"
for line in io.lines(CDFolder.."/"..file..".txt") do
contents = contents..line.."\r\n"
end
SendToAll(Bot,"\r\n"..contents.."\r\n|")
end
function showtextold(user, cmd)
local lines="\r\n\r\n"
for line in io.lines(file) do
lines = lines..line.."\r\n"
end
user:SendPM(Bot, lines.." |")
end
have fun Skynet
landofkaraoke
Hi,
can you put a timer in it.
Thnx.
yeah timer will be cool 4 sure
thx in advince :D
hi, wonderful script Mate..
But it doesnt show which user has used the command..only the ascii appears in main chat.. i want to see which user has used the command..can the script be modified like this ?
function ChatArrival(user, data)
data=string.sub(data,1,string.len(data)-1)
[COLOR=red] if( string.sub(data, 1, 1) == "<" ) then[/COLOR]
s,e,cmd = string.find(data,"%b<>%s+(%S+)")
cmd = string.sub(cmd, 1,string.len(cmd))
if io.open(CDFolder.."/"..cmd..".txt",r) ~= nil then
showtext(user, cmd)
[COLOR=red] return 1[/COLOR]
[COLOR=red]end[/COLOR]
end
end
remove the lines in red !
lol desssmtor i removed the two lines...now its showing the message from text file two times in main
see like this
[18:50]
----- Rules -----
<1.> Do Not Share 0 B ( Share Something ).
<2.> Do Not Disconnect Other Users Download.
<3.> Do Not Advertise For Other Hubs.
<4.> Be Friendly With Other Users.
<5.> Do Not flood In Main Chat.
<6.> Do Not Talk About This Hub To Your Cable Operator.
*** Breaking The Above Rules Will Get Your Ip Banned Or Kicked. ***
[18:50]
----- Rules -----
<1.> Do Not Share 0 B ( Share Something ).
<2.> Do Not Disconnect Other Users Download.
<3.> Do Not Advertise For Other Hubs.
<4.> Be Friendly With Other Users.
<5.> Do Not flood In Main Chat.
<6.> Do Not Talk About This Hub To Your Cable Operator.
you were supposed to remove 3 lines, not only 2,
show me the script u have now!
oops ....working fine now..maybe last time i did some mistake while deleting..
lines
anyways tx m8
can these message in .txt in images folder be sent to main in time intervals.
all files shld be displayed in main chat one by one but there shld be some time interval between files to be sent in main
is it possible ?
QuoteOriginally posted by dkt
can these message in .txt in images folder be sent to main in time intervals.
all files shld be displayed in main chat one by one but there shld be some time interval between files to be sent in main
is it possible ?
Search the forum for "Rotating Message". It does all this and more ;)
Best regards