help - Page 2
 

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

help

Started by Yahoo, 10 April, 2007, 15:37:24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

achiever

Quote from: bastya_elvtars on 12 April, 2007, 18:48:53
Or do not return 1 (but then the command will show up).
yes on this the pxcommands do work but still the line
"Type prefix-help for list of commands available to ur profile"
is always shown

Quote from: Naithif on 12 April, 2007, 18:52:52
Anyway why don't you send it to just the user who entered the command?

well i need it to show command toevery user so the new users come to kno that these commands are present.
hi,

well ppl i have just done some scripting (well modified a completely different script ;-) )

sBot = "Fusion"
Commands = {
	["myip"] = 1,
	["stat"] = 1,
	["reloadtxt"] = 1,
	["getscripts"] = 1,
	["restartscripts"] = 1,
	["clrrangetempbans"] = 1,
	["clrtempbans"] = 1,
	["clrrangepermbans"] = 1,
	["clrpermbans"] = 1,	
	["fav"] = 1,
	["getrangebans"] = 1,
	["getrangepermbans"] = 1,
	["getpermbans"] = 1,
	["getrangetempbans"] = 1,
	["gettempbans"] = 1,
	["help"] = 1,
}

function ChatArrival( user, data)
	local s,e,prefix,cmd = data:find("%b<>%s+(%p)(%S+)|")
		if not Commands[cmd] then
			if prefix and cmd then
				SendToAll(sBot, "Type prefix-help for list of commands available to ur profile")
			--[[elseif prefix then
				SendToAll(sBot, "Did u forget to use the command")]]-- 
			end
		end
end


the comment part  is not working--> it should send message if only perfix is recieved.

well this script also keeps on sending the line
" Type prefix-help for list of commands available to ur profile "
now for the text files of ptokax even if i get to c them.
so can some 1 help me with a better solution?

achiever.
thks,
achiever.

Cêñoßy†ê

#26
this is how i do it
Code: lua
cmd = {}
ChatArrival = function(user,data)
	local data = string.sub(data,1,(string.len(data)-1))
	local _,_,prefix,command = data:find("%b<>%s+(%p)(%S+)")
	if command and cmd[command] then
                SendToAll(data)  -- shows command to all
		return cmd[command](user,data)
	end
	collectgarbage("collect")
end

cmd["test"] = function(user,data)
	user:SendData(frmHub:GetHubBotName(),"command 'test' received")
	return 1
end
Powered By Leviathan™ 2nd Generation v. 1.9

achiever

getting error
[19:12] Syntax D:\Downloads\0.3.5.1.lua5.1.1\scripts\test2.lua:34: attempt to index global 'cmd' (a nil value)
thks,
achiever.

Cêñoßy†ê

Quote from: achiever on 13 April, 2007, 15:51:21
getting error
[19:12] Syntax D:\Downloads\0.3.5.1.lua5.1.1\scripts\test2.lua:34: attempt to index global 'cmd' (a nil value)
post updated with cmd = {} in script start
Powered By Leviathan™ 2nd Generation v. 1.9

achiever

hi cenobyte,

i m abit confused,
i was trying to make a script which would send a message
"Type prefix-help for list of commands available to ur profile"
if user uses a unknown command.

the script i made up started to send the message for ptokax basic commands also, so i had to add that table.
but now still it is sending the message for the text files which i use.
so now plzz explain how should i use ur code to help solving my problem.

thks,
achiever.
thks,
achiever.

SMF spam blocked by CleanTalk