+me to !me
 

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

+me to !me

Started by VAZ, 25 March, 2005, 12:56:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

VAZ

i need a script that will work like this: when somone uses +me command the + will automaticly be transefered to ! so it will be like he did !me

thanks in advance.

TTB

Hi,

Changed it for u... Plop made the script, here it is in LUA 5:

-- adds +me and /me support.
-- plop
-- Changed into LUA 5 by TTB

function ChatArrival(user, data)
   data=string.sub(data,1,string.len(data)-1) 
   if( string.sub(data, 1, 1) == "<" ) then
      local s,e,cmd = string.find(data,"%b<>%s+(%S+)") 
      if cmd == "+me" or cmd == "/me" or cmd == "#me" then
         local s,e,msg = string.find(data,"%b<>%s+%S+%s+(.*)") 
         SendToAll("* "..user.sName.." "..msg)
         return 1
      end
   end
end
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

plop

#2
check out this word replacer, it includes !me in main and pm.
make sure you make a folder called error, forgot 2 add this 2 the zip.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

TTB

#3
folder "error" added... still got an error >>

No syntax errors in script file zzword_replacer_1.2.lua_5.0_public.lua
Syntax cannot read wordreplace/tLadys.lua: No such file or directory

*edit*

also got this message:

Syntax ...\LUA5\scripts\zzword_replacer_1.2.lua_5.0_public.lua:158: attempt to index global `tBadWords' (a nil value)
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

plop

QuoteOriginally posted by TTB
folder "error" added... still got an error >>

No syntax errors in script file zzword_replacer_1.2.lua_5.0_public.lua
Syntax cannot read wordreplace/tLadys.lua: No such file or directory

*edit*

also got this message:

Syntax ...\LUA5\scripts\zzword_replacer_1.2.lua_5.0_public.lua:158: attempt to index global `tBadWords' (a nil value)
remove line 142 ( dofile("wordreplace/tLadys.lua") )
the other 1 might disapear after that, if not you are missing the data files.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

TTB

#5
Hi,

I'm checking it atm... It seems to work well now. Just refering to the question of this threat starter, your LUA4 script (coverted to lua5) will do also the job.

This code is also nice to use, I will use it. Thanx for your support  :D

Dank je wel Plop  :]

*edited*
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Casanova82

Syntax D:\DC\0.3.3.0.b16.09.nt.rls\scripts\me.lua:11: attempt to concatenate local `msg' (a nil value)

Madman

-- adds +me and /me support.
-- plop
-- Changed into LUA 5 by TTB
-- Madman messed with it

function ChatArrival(user, data)
	data=string.sub(data,1,string.len(data)-1) 
	local s,e,cmd = string.find(data,"%b<>%s+(%S+)") 
	if cmd == "+me" or cmd == "/me" or cmd == "#me" then
		local s,e,msg = string.find(data,"%b<>%s+%S+%s+(.*)") 
		if msg == nil then
			SendToAll("* "..user.sName)
		else
			SendToAll("* "..user.sName.." "..msg)
		end
		return 1
	end
end
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

plop

-- adds +me and /me support.
-- plop
----
-- Changed into LUA 5.
-- TTB
----
-- Madman messed with it
----
-- msg can't be nil anymore.
-- takes all kind of prefixes.
--plop.
----

function ChatArrival(user, data)
	local data=string.sub(data,1,string.len(data)-1) 
	local s,e,cmd = string.find(data,"%b<>%s+%p(%S+)") 
	if cmd == "me" then
		local s,e,msg = string.find(data,"%b<>%s+%S+%s*(.*)")
		SendToAll("* "..user.sName.." "..msg)
		return 1
	end
end

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

TTB

LoLz... the %p  :D
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

bastya_elvtars

There was no example anywhere what %p exactly means. :D
Everything could have been anything else and it would have just as much meaning.

TTB

Well.. there is:

. all characters 
%a letters 
%c control characters 
%d digits 
%l lower case letters 
%p punctuation characters 
%s space characters 
%u upper case letters 
%w alphanumeric characters 
%x hexadecimal digits 
%z the character with representation 0 
%b<> matches anything between the < >, they can be replaced by anything you want

Link: *CLICK*

But I also didn't know what punctuation characters were...
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

plop

QuoteOriginally posted by bastya_elvtars
There was no example anywhere what %p exactly means. :D
i believe it's explained more clearly in the lua book.
if not i must have found it on some website. lol
you can also use %S(%S+), hereby skipping the 1st char.
but this is using a bit more resouces.
ame, bme, cme, would also work there.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk