PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: DJKiwi on 09 July, 2005, 09:03:07

Title: Help with rightclicker
Post by: DJKiwi on 09 July, 2005, 09:03:07
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 :]
Title:
Post by: Star on 09 July, 2005, 11:13:27
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
Title:
Post by: DJKiwi on 09 July, 2005, 12:26:52
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)
Title:
Post by: damo on 09 July, 2005, 13:34:20
it apears your missing the pipe of the end this is the pipe | try  this
sMenu = "-=]-[?R???R?=-"

SendTo = { --> 1=on/0=off
Title:
Post by: Dessamator on 09 July, 2005, 15:22:44
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
Title:
Post by: DJKiwi on 11 July, 2005, 14:09:46
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
Title:
Post by: Dessamator on 11 July, 2005, 18:41:02
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!