small ascii script
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

small ascii script

Started by Skynet, 04 March, 2005, 13:05:06

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Skynet

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

Copyright SkynetSystems 2000-2005 @Phoenix Network

Helper

Hi,

can you put a timer in it.

Thnx.
1 dag niet gelachen is 1 dag niet geleefd.

RoboCop? 10.01a Made by Optimus?

witch

yeah timer will be cool 4 sure  

thx in advince  :D



dkt

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 ?

Dessamator

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 !
Ignorance is Bliss.

dkt

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.

Dessamator

you were supposed to remove 3 lines, not only 2,
show me the script u have now!
Ignorance is Bliss.

dkt

oops ....working fine now..maybe last time i did some mistake while deleting..
 lines
anyways tx m8

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 ?

jiten

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

SMF spam blocked by CleanTalk