Help with rightclicker
 

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 with rightclicker

Started by DJKiwi, 09 July, 2005, 09:03:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DJKiwi

I'm a total noob at this i think,, can someone fix it??

sMenu = "-=]-[?R???R?=-"

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

dofile("tbl/scriptlevel.tbl")
dofile("tbl/inbuildlevel.tbl")

-- End Editable Settings --

GetRightClick = function(user, table1, table2)
	for cmd,level in table1 do
		if table1[cmd][user.iProfile] == 1 then
			if table2[cmd] then
				user:SendData(table2[cmd].."||")
			end
		end
	end
end

NewUserConnected = function(user)
	if SendTo[user.iProfile] == 1 then
		if user.bUserCommand then
			user:SendData("$UserCommand 0 3 |")
			GetRightClick(user, ScriptLevel, ScriptCmds) GetRightClick(user, InbuildLevel, InbuildCmds) customCMDs(user)
			user:SendData(" Enhanced Right Click Support for [RoboCop] is available!")
		end
	end
end

OpConnected=NewUserConnected

>>>I've cut out the standard part of zRightclicker.lua because of the length, in my own file it's there:P<<<

customCMDs = function(user)
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\AddAccount +account|")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\MyStatus +status|")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\Top10 +rank|")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\Loan +loan %[line:Howmuch]|")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\RepayLoan +Repay %[line:Howmuch]|")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\Play +play|")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\Reset +Reset|")

end


hmmm the spaces are incorrect on this page:S they are cut away:S

UPDATE: Already got it working :]

Star

Change this:
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\AddAccount +account|")

To This:
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\AddAccount$<%[mynick]> +account|")
.....and so on........

/Star

DJKiwi

QuoteOriginally posted by Star
Change this:
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\AddAccount +account|")

To This:
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\AddAccount$<%[mynick]> +account|")
.....and so on........

/Star

Nope mate... doesn't work.. at first the script works..
then when i reconnect error: Syntax ..\..\..\..\Rightclicker.lua:18: Attempt to index global `user' {a nil value)

damo

it apears your missing the pipe of the end this is the pipe | try  this
sMenu = "-=]-[?R???R?=-"

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

dofile("tbl/scriptlevel.tbl")
dofile("tbl/inbuildlevel.tbl")

-- End Editable Settings --

GetRightClick = function(user, table1, table2)
   for cmd,level in table1 do
      if table1[cmd][user.iProfile] == 1 then
         if table2[cmd] then
            user:SendData(table2[cmd].."||")
         end
      end
   end
end

NewUserConnected = function(user)
   if SendTo[user.iProfile] == 1 then
      if user.bUserCommand then
         user:SendData("$UserCommand 0 3 |")
         GetRightClick(user, ScriptLevel, ScriptCmds) GetRightClick(user, InbuildLevel, InbuildCmds) customCMDs(user)
         user:SendData(" Enhanced Right Click Support for [RoboCop] is available!")
      end
   end
end

OpConnected=NewUserConnected

>>>I've cut out the standard part of zRightclicker.lua because of the length, in my own file it's there:P<<<

customCMDs = function(user)
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\AddAccount +account||")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\MyStatus +status||")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\Top10 +rank||")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\Loan +loan %[line:Howmuch]||")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\RepayLoan +Repay %[line:Howmuch]||")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\Play +play||")
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\Reset +Reset||")

Dessamator

#4
nop, it doesnt need the end pipes

customCMDs = function(user) 
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\AddAccount +account|")


heres my hint :

lua is case sensitive , eg.: senddata is not equal to SendData

P.S. thats just a hint
Ignorance is Bliss.

DJKiwi

#5
QuoteOriginally posted by Dessamator
nop, it doesnt need the end pipes

customCMDs = function(user) 
User:SendData("$UserCommand 1 3 "..sMenu.."\\SLOTSMACHINE\\AddAccount +account|")


heres my hint :

lua is case sensitive , eg.: senddata is not equal to SendData

P.S. thats just a hint

I already know how to solve:p

customCMDs = function(User) --// You can put your custome commands here
   --User:SendData("$UserCommand 1 3 zCUSTOM\\Test$<%[mynick]> !test||")   -- Example line
   User:SendData("$UserCommand 1 3 "..zMenu.."\\AddAccount$<%[mynick]> +account||")
   User:SendData("$UserCommand 1 3 "..zMenu.."\\MyStatus$<%[mynick]> +status||")
   User:SendData("$UserCommand 1 3 "..zMenu.."\\Top10$<%[mynick]> +rank||")
   User:SendData("$UserCommand 1 3 "..zMenu.."\\Loan$<%[mynick]> +loan %[line:Howmuch]||")
   User:SendData("$UserCommand 1 3 "..zMenu.."\\RepayLoan$<%[mynick]> +Repay %[line:Howmuch]||")
   User:SendData("$UserCommand 1 3 "..zMenu.."\\Play$<%[mynick]> +play||")
   User:SendData("$UserCommand 1 3 "..zMenu.."\\Reset$<%[mynick]> +Reset||")
   User:SendData("$UserCommand 1 1 "..kMenu.."\\Op Commands\\Do to a user\\Kennylize$<%[mynick]> !kenny %[line:Who do you want to kennylize?]||")
   User:SendData("$UserCommand 1 1 "..kMenu.."\\Op Commands\\Do to a user\\UnKennylize$<%[mynick]> !unkenny %[line:Who do you want to unkennylize?]||")
   User:SendData("$UserCommand 1 2 "..kMenu.."\\Op Commands\\Do to a user\\Kennylize$<%[mynick]> !kenny %[nick]||")
   User:SendData("$UserCommand 1 2 "..kMenu.."\\Op Commands\\Do to a user\\UnKennylize$<%[mynick]> !unkenny %[nick]||")

end

this works in costum commands:P:P my mistake was to remove the example i think.. when i put it back it worked:p

dchub://greengrocer.no-ip.info

Dessamator

nop that wasnt the error. the error was that , User is not  equal to user

either way remove the end pipe ---> | from ur script

it can cause errors on some clients!
Ignorance is Bliss.

SMF spam blocked by CleanTalk