ascii intead of talking
 

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

ascii intead of talking

Started by Re@SoN, 01 July, 2005, 20:35:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Re@SoN

well guys, i have 1 ideia for my hub but i need help for that. :p

the ideia is:
that users would have a righclick menu with comands so they can talk by ascii draws...
what i would like to have is a script, with righclick menu, that reads the ascii draw from a directory inside ptokax\scripts...something like artbot 1.0 but with righclick menu :)

best regards,
Re@SoN

Loading

hi

you can put your own commands in right cliker menu

put art bot commands in there


best regards

Loading

Re@SoN

hi loading... ;)
i already think that, use the zrighclick script from robo to do that by puting some comands to the txt's...
but if that can be made my doughts are:

1? -  were do i have to put the asciis draws in way the script can read them..or do i have to create a new folder just to ascii draws....!?

2? -  the lines of code are the same to do that!?...

so i'm in a impass and need some help/advise..
if can be made in zrightclick and you or anyone knows how, plaese just post a example line and i'll do the rest...:)

[[[[]]]],
Re@SoN

Loading

hi

i'm working on it

:)


when i finish it i post here


best regards


Loading

??????Hawk??????

#4
hi

Make a folder Within your scripts folder called  ' ascii   '
Fill that folder up with your Ascii files and restart the script..
Check the right click menu..



-- Yet another version AsciiTexter Bot
--  By ??????Hawk?????? 03/07/2005

AsciiBotName = "AsciiTexter"	--// Set Bot name here 

function ChatArrival(curUser, data) 
	data = string.sub(data,1,string.len(data)-1)
	local _,_,PRFX,text = string.find( data, "%b<>%s+(%S)(%S+).*" )	
		if PRFX == Prefix and text and AsciiTable[text] then			
				local handle,Er = io.open("ascii/"..text..".txt", "r")
				if handle then								
					local line = handle:read("*l")
					TempAsciifile = "\r\n"
						while line do 
							TempAsciifile = TempAsciifile.."\r\n"..line
							line =handle:read("*l")
						end 
					handle:close() 
				end
				SendToAll(AsciiBotName, "<"..curUser.sName..">\r\n"..TempAsciifile)
			return 1
		end 
end



function Main()
	Prefix = "!"
	AsciiTable = {}
	local sDirectory = "ascii"
   	local sFileName = "Alisting.txt"
   	local sLine = nil;
   	os.execute("dir /b /a-d \""..sDirectory.."\" > \""..sFileName.."\"");
   	local ahFile,e = io.open(sFileName,"r")  
   	sLine = ahFile:read("*l");
	sLine = string.sub(sLine, 1, (string.len(sLine)-4))
	AsciiTable[sLine] = 1
   		while ( sLine ) do
      		sLine = ahFile:read("*l");
				if sLine ~= nil then
					sLine = string.sub(sLine, 1, (string.len(sLine)-4))
					AsciiTable[sLine] = 1
				end
   		end
		ahFile:close()
   		os.remove(sFileName);
end

NewUserConnected = OpConnected

function OpConnected(curUser) 
	curUser:SendData("$UserCommand 255 |") -- clear
		for STCommand,q in AsciiTable do
				curUser:SendData("$UserCommand 1 3 "..AsciiBotName.."\\"..STCommand.."$<%[mynick]> !"..STCommand.."||")
		end
end

Have fun....

??????Hawk??????

Dessamator

#5
hmm, well done hawk, very nice and neat , except for the extra end pipes, not needed
Ignorance is Bliss.

??????Hawk??????

#6
QuoteOriginally posted by Dessamator
hmm, well done hawk, very nice and neat , except for the extra end pipes, not needed


Ive never touched a Pipe in my life..  i prefer the Smoother smoke of....   Ehem " Roll Your Own "  ( if you know what i mean )   ;)  ;)


ohh  and regardin the script  ..  yeh  maby i should have spent more time on it ..  say  at least   6 mins   :P

anyway  aint it your job to take a script and make it worthy of running  ??    :D  :D

Dessamator

my JOB?, yikes, hehe i have to start charging for it then, either way, the script is probably functional, but as plop once said, the "pipes" would cause errors with some dcs, :),  anyways, its far simpler for u to edit the script rather than for me to copy and paste it again !

as for smoking pipes, or rolling, dont do that, its bad for ur health just ask bastya, the doctor ! :)
Ignorance is Bliss.

Re@SoN

hi guys!
tks ??????Hawk?????? for helping me out by doing this script...i tested and works.  :]
but i would like to have something like this:

sMenu = "name of menu"

SendTo = { --> 1=on/0=off
[0] = 1,   -- Masters
[1] = 1,   -- Operators
[2] = 1,   -- Vips
[3] = 1,   -- Regs
[4] = 1,   -- Moderator
[5] = 1,   -- NetFounder
[-1] = 0,  -- Users
}

so i can activate or desactivate the rightclick menu.
(made this part of code by my self but don't know if it fit's and were to put) :P

and them i think this will be a perfectly script! no dought  :]


best regards,
Re@SoN

??????Hawk??????

#9
-- Yet another version AsciiTexter Bot
--  By ??????Hawk?????? 03/07/2005
-- Create an   ascii folder within the scripts folder and copy all your ascii files in.

AsciiBotName = "AsciiTexter"	--// Set Bot name here 

[COLOR=blue]SendTo = { --> 1=on/0=off 
[0] = 1, -- Masters 
[1] = 1, -- Operators 
[2] = 1, -- Vips 
[3] = 1, -- Regs 
[4] = 1, -- Moderator 
[5] = 1, -- NetFounder 
[-1] = 0, -- Users 
} [/COLOR]  



function ChatArrival(curUser, data) 
	data = string.sub(data,1,string.len(data)-1)
	local _,_,PRFX,text = string.find( data, "%b<>%s+(%S)(%S+).*" )	
		if PRFX == Prefix and text and AsciiTable[text] then			
				local handle,Er = io.open("ascii/"..text..".txt", "r")
				if handle then								
					local line = handle:read("*l")
					TempAsciifile = "\r\n"
						while line do 
							TempAsciifile = TempAsciifile.."\r\n"..line
							line =handle:read("*l")
						end 
					handle:close() 
				end
				SendToAll(AsciiBotName, "<"..curUser.sName..">\r\n"..TempAsciifile)
			return 1
		end 
end



function Main()
	Prefix = "!"
	AsciiTable = {}
	local sDirectory = "ascii"
   	local sFileName = "Alisting.txt"
   	local sLine = nil;
   	os.execute("dir /b /a-d \""..sDirectory.."\" > \""..sFileName.."\"");
   	local ahFile,e = io.open(sFileName,"r")  
   	sLine = ahFile:read("*l");
	sLine = string.sub(sLine, 1, (string.len(sLine)-4))
	AsciiTable[sLine] = 1
   		while ( sLine ) do
      		sLine = ahFile:read("*l");
				if sLine ~= nil then
					sLine = string.sub(sLine, 1, (string.len(sLine)-4))
					AsciiTable[sLine] = 1
				end
   		end
		ahFile:close()
   		os.remove(sFileName);
end

NewUserConnected = OpConnected

function OpConnected(curUser) 
	 [COLOR=red]if SendTo[curUser.iProfile] == 1 then[/COLOR] 
		curUser:SendData("$UserCommand 255 ") -- clear
		for STCommand,q in AsciiTable do
				curUser:SendData("$UserCommand 1 3 "..AsciiBotName.."\\"..STCommand.."$<%[mynick]> !"..STCommand.."|")
		end
	[COLOR=red]end[/COLOR] 
end

Re@SoN

tks very much ??????Hawk?????? for helping me out, by making this script, it's just perfect for what i need  :D

i'm learning lua and this make me understand better "how to.."
and some day i'll post my fist script here(i hope)!


respectfully,
Re@SoN

SMF spam blocked by CleanTalk