Prob with menu(left mouse)
 

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

Prob with menu(left mouse)

Started by mandix, 02 June, 2004, 01:51:23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mandix

i am makeing a custom right click menu
but i got a error that i cant solve, can u help me ?!?

ANYONE, ?? plz ??

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

sMenu = "RC"

assert(dofile("tbl/checklevel.tbl"),"tbl/checklevel.tbl not found")

function OpConnected(user)
	if (SendTo[user.iProfile]==1) then
		GetRightClickComs(user)
		customCMDs(user)
		user:SendData("Enhanced Right Click Support is available!")
	end
end

function NewUserConnected(user)
	if (SendTo[user.iProfile]==1) then
		GetRightClickComs(user)
		customCMDs(user)
		user:SendData("Enhanced Right Click Support is available!")
	end
end

function GetRightClickComs(user) 
	TCopy={}
	for cmd,_ in LevelCheck do
	if LevelCheck[cmd][user.iProfile] == 1 then
	for value,command in RightClick do
	if cmd == value then
	tinsert(TCopy,{value,command})
	end end end end

	sort(TCopy,function(a,b) return (a[1] < b[1]) end)
	for t = 1, getn(TCopy) do
	if TCopy[t] then user:SendData(TCopy[t][2])
	end end TCopy={} collectgarbage() flush()
end

function customCMDs(user)

	user:SendData("$UserCommand 1 3 User Commands\\FaQ$<%[mynick]> !faq||",
	user:SendData("$UserCommand 1 3 User Commands\\Rules$<%[mynick]> !rules||",
	user:SendData("$UserCommand 1 3 User Commands\\Network$<%[mynick]> !network||",
	user:SendData("$UserCommand 1 3 User Commands\\Bandit\\Off$<%[mynick]> b.stop||",
	user:SendData("$UserCommand 1 3 User Commands\\Bandit\\On$<%[mynick]> b.start||",
	user:SendData("$UserCommand 1 3 User Commands\\My Info\\My IP$<%[mynick]> !myip||",
	user:SendData("$UserCommand 1 3 User Commands\\My Info\\My Info$<%[mynick]> !myinfo||",
end      -- line 55

RightClick = { -- op commands here }


error :

Syntax error: expected;
  last token read: `end' at line 55 in string "SendTo = {
..."

VidFamne

You've forgotten to close the parenthesis with this ")"

bastya_elvtars

Everything could have been anything else and it would have just as much meaning.

Herodes

mandix it's there already man ... Don't double post ...
keep it simple ... You 'll get your answers most of the times ..

SMF spam blocked by CleanTalk