PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: slik_jatt on 19 August, 2004, 16:59:54

Title: Need help !!,Right Click commands Script
Post by: slik_jatt on 19 August, 2004, 16:59:54
this is the base , script code i have.
what i need to do is instead of having the users to type in commands in the hub ie : !albums for album list, i want them to simply click on an option . or right click option.  I need help with the coding i guess :)

i got the *** z_rightclick script *** and theres ptokax main script installed on the hub.


here it is if u cant find the script:
___________________________

-- RightClicker v3.0
--
-- RoboCop 7.X Version <-> Made by Optimus & TiMeTrAVelleR
-- Script only works togheter with RC7.X or Higher
--
-- USE SCRIPT AT YOUR OWN RISK, IT MAY NOT BE COMPATIBLE WITH ALL CLIENTS

-- Editable Settings --

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

sMenu = "RC"

-- End Editable Settings --

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("<(??T)????`????????????`????> To Add this hub to favorite type /fav ")
end
end

function NewUserConnected(user)
if (SendTo[user.iProfile]==1) then
GetRightClickComs(user)
customCMDs(user)
user:SendData("<(??T)????`????????????`????> To Add this hub to favorite type /fav")
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={}
end

function customCMDs(user)
--user:SendData("$UserCommand 1 3 zCUSTOM\\Test$<%[mynick]> +test||") -- test
end

RightClick = {
[10]="$UserCommand 1 3 Kick User$<%[mynick]> !kick %[nick] %[line:Reason]||", -- kick
[20]="$UserCommand 1 3 Ban User$<%[mynick]> !ban %[nick] %[line:Reason]||", -- ban
[30]="$UserCommand 1 3 Nameban User$<%[mynick]> !nameban %[nick] %[line:Reason]||", -- nameban
[40]="$UserCommand 1 3 Timeban User$<%[mynick]> !timeban %[nick] %[line:hr:mn] %[line:Reason]||", -- timeban
[50]="$UserCommand 1 3 Kill User $<%[mynick]> !kill %[nick] %[file] %[line:Reason]||", -- kill
[60]="$UserCommand 1 3 Warn User$<%[mynick]> !warn %[nick] %[line:Reason]||", -- warn
[70]="$UserCommand 1 3 Flood User$<%[mynick]> !flood %[nick] %[line:Nr] %[line:Reason]||", -- flood
[80]="$UserCommand 1 3 Drop User$<%[mynick]> !drop %[nick]||", -- drop
[90]="$UserCommand 1 3 Gag User$<%[mynick]> !gag %[nick]||", -- gag
[100]="$UserCommand 1 3 UnGag User$<%[mynick]> !ungag %[nick]||", -- ungag
[110]="$UserCommand 1 3 INBUILD\\BanIp User$<%[mynick]> !banip %[line:Ipnumber]||", -- banip
[120]="$UserCommand 1 3 INBUILD\\Unban User$<%[mynick]> !unban %[nick] %[line:nick/ip]||", -- unban
[130]="$UserCommand 1 3 INBUILD\\Nickban User$<%[mynick]> !nickban %[nick] %[line:Reason]||", -- nickban
[140]="$UserCommand 1 3 INBUILD\\GetBanlist$<%[mynick]> !getbanlist||", -- getbanlist
[150]="$UserCommand 1 3 INBUILD\\Clear Permban$<%[mynick]> !clrpermban||", -- clrpermban
[160]="$UserCommand 1 3 INBUILD\\Clear Tempban$<%[mynick]> !clrtempban||", -- clrtempban
[170]="$UserCommand 1 3 INBUILD\\Temp Op$<%[mynick]> !op %[nick]||", -- op
[180]="$UserCommand 1 3 INBUILD\\Basic Info User$<%[mynick]> !getinfo %[nick]||", -- getinfo
[190]="$UserCommand 1 3 INBUILD\\Show Users with that ip$<%[mynick]> !getinfo %[line:Ipnumber]||", -- ipinfo
[200]="$UserCommand 1 3 INBUILD\\Show Users within that iprange$<%[mynick]> !iprangeinfo %[line:Ipnumber]||", -- iprangeinfo
[220]="$UserCommand 1 3 SETTING\\Restart Hub$<%[mynick]> !restart||", -- restart
[230]="$UserCommand 1 3 SETTING\\Restart Scripts$<%[mynick]> !restartscripts||", -- restartscripts
[240]="$UserCommand 1 3 SETTING\\Hub Config$<%[mynick]> !hconfig||", -- hconfig
[250]="$UserCommand 1 3 SETTING\\Hub Stats$<%[mynick]> !hstat||", -- hstat
[260]="$UserCommand 1 3 INFO\\User Info$<%[mynick]> !info %[nick]||", -- info
[270]="$UserCommand 1 3 OTHER\\Mass Message$<%[mynick]> !mass %[line:Message]||", -- mass
[280]="$UserCommand 1 3 OTHER\\Send Banner$<%[mynick]> !banner %[line:Advert]||", -- banner
[290]="$UserCommand 1 3 OTHER\\Send Advertise mesage$<%[mynick]> !sendhubad %[line:main/pm]||", -- sendhubad
[300]="$UserCommand 1 3 OTHER\\Talk Whitout Nick$<%[mynick]> !talk %[line:Message]||", -- talk
[310]="$UserCommand 1 3 OTHER\\Online Check User$<%[mynick]> !online %[nick]||", -- online
[320]="$UserCommand 1 3 OTHER\\Offline Message To User$<%[mynick]> !offline %[nick] %[line:Message]||", -- offline
[340]="$UserCommand 1 3 OTHER\\Watch a User$<%[mynick]> !watch %[nick]||", -- watch
[350]="$UserCommand 1 3 OTHER\\Watch Off$<%[mynick]> !watchoff||", -- watchoff
[360]="$UserCommand 1 3 OTHER\\Show Watchers$<%[mynick]> !getwatch||", -- getwatch
[370]="$UserCommand 1 3 OTHER\\Set CommandSpy on/off$<%[mynick]> !cmdspy %[line:on/off]||", -- cmdspy
[380]="$UserCommand 1 3 NORMAL\\Topkickers$<%[mynick]> !topkickers||", -- topkickers
[390]="$UserCommand 1 3 NORMAL\\TopHubbers Online Time$<%[mynick]> !tophubbers||", -- tophubbers
[400]="$UserCommand 1 3 SETTING\\Set Script Minslots$<%[mynick]> !sminslots %[line:user/reg/vip/op/mod/master/founder] %[line:slots]||", -- sminslots
[410]="$UserCommand 1 3 SETTING\\Set Script Maxslots$<%[mynick]> !smaxslots %[line:user/reg/vip/op/mod/master/founder] %[line:slots]||", -- smaxslots
[420]="$UserCommand 1 3 SETTING\\Set Script Max Hubs$<%[mynick]> !smaxhubs %[line:user/reg/vip/op/mod/master/founder] %[line:hubs]||", -- smaxshubs
[430]="$UserCommand 1 3 SETTING\\Set Script Slots/Hubs Ratio$<%[mynick]> !sratio  %[line:user/reg/vip/op/mod/master/founder] %[line:slots]||", -- sratio
[440]="$UserCommand 1 3 SETTING\\Set Script MinShare$<%[mynick]> !sminshare %[line:user/reg/vip/op/mod/master/founder] %[line:share] %[line:mb/gb]||", -- sminshare
[460]="$UserCommand 1 3 SETTING\\Set Script Maxshare$<%[mynick]> !smaxshare %[line:user/reg/vip/op/mod/master/founder] %[line:share] %[line:mb/gb]||", -- smaxshare
[470]="$UserCommand 1 3 SETTING\\Set Hub Minshare$<%[mynick]> !hminshare %[line:Number] %[line:b/kb/mb/gb]||", -- hminshare
[480]="$UserCommand 1 3 SETTING\\Set Max Users$<%[mynick]> !hmaxusr %[line:Number]||", -- hmaxusr
[490]="$UserCommand 1 3 SETTING\\Set Hub Description$<%[mynick]> !hdesc %[line:Hub_Description]||", -- hdesc
[500]="$UserCommand 1 3 SETTING\\Set HubName$<%[mynick]> !chhubname %[line:New Hubname]||", -- chhubname
[510]="$UserCommand 1 3 SETTING\\Set RegServer$<%[mynick]> !regserver %[line:New_Reg_Address]||", -- regserver
[520]="$UserCommand 1 3 SETTING\\Set Redirect Adress$<%[mynick]> !redirect %[line:Host /Ip]||", -- redirect
[530]="$UserCommand 1 3 SETTING\\Set Redirect Full on/off$<%[mynick]> !redirectfull %[line:on/off]||", -- redirectfull
[540]="$UserCommand 1 3 SETTING\\Set Auto Redirect on/off$<%[mynick]> !autoredirect %[line:on/off]||", -- autoredirect
[550]="$UserCommand 1 3 SETTING\\Set Hub Protect on/off$<%[mynick]> !hubprotect %[line:on/off]||", -- hubprotect
[560]="$UserCommand 1 3 OTHER\\Show Blocked Users$<%[mynick]> !getblocked||", -- getblocked
[564]="$UserCommand 1 3 OTHER\\Mass Message Blocked Users$<%[mynick]> !massblocked %[line:Message]||", -- massblocked
[570]="$UserCommand 1 3 REGISTER\\Reg User$<%[mynick]> !regreg %[nick] %[line:Password]||", -- regreg
[580]="$UserCommand 1 3 REGISTER\\Reg Vip$<%[mynick]> !regvip %[nick] %[line:Password]||", -- regvip
[590]="$UserCommand 1 3 REGISTER\\Reg Op$<%[mynick]> !regop %[nick] %[line:Password]||", -- regop
[594]="$UserCommand 1 3 REGISTER\\Reg Moderator$<%[mynick]> !regmod %[nick] %[line:Password]||", -- regmop
[600]="$UserCommand 1 3 REGISTER\\Reg Master$<%[mynick]> !regmaster %[nick] %[line:Password]||", -- regmaster
[604]="$UserCommand 1 3 REGISTER\\Reg Founder$<%[mynick]> !regfounder %[nick] %[line:Password]||", -- regfounder
[610]="$UserCommand 1 3 REGISTER\\Del Reg User$<%[mynick]> !deluser %[nick]||", -- deluser
[620]="$UserCommand 1 3 REGISTER\\Upgrade Reg User$<%[mynick]> !upgrade %[nick] %[line:reg/vip/op/mod/master/founder]||", -- upgrade
[650]="$UserCommand 1 3 SETTING\\ResetCounters$<%[mynick]> !resethstat||", -- resethstat
[654]="$UserCommand 1 3 LOG\\Clear Nick$<%[mynick]> !clear %[nick]||", -- clear
[660]="$UserCommand 1 3 LOG\\ShowIplog$<%[mynick]> !showiplog||", -- showiplog
[670]="$UserCommand 1 3 LOG\\ShowKicklog$<%[mynick]> !showkicklog||", -- showkicklog
[680]="$UserCommand 1 3 LOG\\ShowBanlog$<%[mynick]> !showbanlog||", -- showbanlog
[694]="$UserCommand 1 3 LOG\\ShowWarnlog$<%[mynick]> !showwarnlog||", -- showwarnlog
[710]="$UserCommand 1 3 LOG\\Del Kicklog$<%[mynick]> !delkicklog||", -- delkicklog
[720]="$UserCommand 1 3 LOG\\Del Banlog$<%[mynick]> !delbanlog||", -- delbanlog
[732]="$UserCommand 1 3 LOG\\Del Warnlog$<%[mynick]> !delwarnlog||", -- delwarnlog
[734]="$UserCommand 1 3 LOG\\Showlog name/ip$<%[mynick]> !showlog %[line:Name/Ip] ||", -- showlog
[740]="$UserCommand 1 3 NORMAL\\Rules$<%[mynick]> !rules||", -- rules
[750]="$UserCommand 1 3 NORMAL\\Show hubs in network$<%[mynick]> !network||", -- network
[760]="$UserCommand 1 3 NORMAL\\Show faq about DC++$<%[mynick]> !faq||", -- faq
[770]="$UserCommand 1 3 NORMAL\\Show your currently IP number$<%[mynick]> !myip||", -- myip
[780]="$UserCommand 1 3 NORMAL\\Show all your aviable Info$<%[mynick]> !myinfo||", -- myinfo
[790]="$UserCommand 1 3 NORMAL\\Show script version$<%[mynick]> !version||", -- version
[800]="$UserCommand 1 3 NORMAL\\Self Register$<%[mynick]> !regme %[line:Password]||", -- regme
[810]="$UserCommand 1 3 NORMAL\\Change your own password$<%[mynick]> !repass %[line:New Pass]||", -- repass
[820]="$UserCommand 1 3 NORMAL\\Show users from selected profile$<%[mynick]> !showreg %[line:reg/vip/op/mod/master/founder]||", -- showreg
[830]="$UserCommand 1 3 NORMAL\\Set away message$<%[mynick]> !away %[line:Message]||", -- away
[840]="$UserCommand 1 3 NORMAL\\Back after an away$<%[mynick]> !back||", -- back
[850]="$UserCommand 1 3 NORMAL\\Show all away messages$<%[mynick]> !getaways||", -- getaways
[860]="$UserCommand 1 3 NORMAL\\Report User to all OP's in PM$<%[mynick]> !report %[nick] %[line:Message]||", -- report
[870]="$UserCommand 1 3 NORMAL\\Shows Youre Online Time in Hub$<%[mynick]> !myhubtime|| ", -- myhubtime
[880]="$UserCommand 1 3 NORMAL\\Shows Users whit free slots$<%[mynick]> !slots||", -- slots
[890]="$UserCommand 1 3 NORMAL\\Shows available redirect addresses$<%[mynick]> !jump||", -- jump
[900]="$UserCommand 1 3 NORMAL\\Help Commands$<%[mynick]> !help||", -- help
[910]="$UserCommand 1 3 NORMAL\\Show Inbuild Commands$<%[mynick]> !inbuild %||", -- inbuild

}




Title:
Post by: (=CyberPimp=) on 19 August, 2004, 18:11:31
you can use the custom commands option for that, for example change the colored to fit your needs.
Catagory
CommandName
Command

user:SendData("$UserCommand 1 3 [COLOR=crimson]Albums[/COLOR] \\[COLOR=indigo]Albums list[/COLOR]  $<%[mynick]> [COLOR=blue]!albums[/COLOR] ||")

or with question :

user:SendData("$UserCommand 1 3 [COLOR=crimson]Stuff[/COLOR] \\[COLOR=indigo]See Stuff[/COLOR] $<%[mynick]> [COLOR=blue]+stuff[/COLOR]  [COLOR=green]%[line:Appz/Games/Music/Movie][/COLOR]&# 124;|")

Hope this helps
Title:
Post by: slik_jatt on 19 August, 2004, 18:28:04
so its this part ur talkin about??

function customCMDs(user)
   --user:SendData("$UserCommand 1 3 zCUSTOM\\Test$<%[mynick]> +test||")   -- test
   end



and what about the lists... the txt files that ill have to create.. how do i direct the commands to them?
Title:
Post by: slik_jatt on 19 August, 2004, 19:13:26
hey it worked, thnx for the help, awesome  stuff :)
Title:
Post by: slik_jatt on 20 August, 2004, 01:42:05
hwo would i create sub menus,.. can u help me htere too :)
Title:
Post by: TiMeTrAVelleR on 20 August, 2004, 06:22:11
user:SendData("$UserCommand 1 3 "..sMenu.."\\NEWSONGS\\Read New Songs$<%[mynick]> !read||")


now you have submenu ;)
Title:
Post by: slik_jatt on 21 August, 2004, 04:28:47
nothing happend man...


here are the tabs i want inthe sub men


_______________________


user:SendData("$UserCommand 1 3 Bhangra Music$<%[mynick]> !bhangra ||")   --    
user:SendData("$UserCommand 1 3 Singles$<%[mynick]> !singles ||")   --
user:SendData("$UserCommand 1 3 Bollywood Music$<%[mynick]> !bmusic ||")


where should i insert the sub menu commands can u pls jus do a demo short copy paste , would be great , thnx
Title:
Post by: TiMeTrAVelleR on 21 August, 2004, 06:06:22
user:SendData("$UserCommand 1 3 "..sMenu.."\\Bhangra Music\\$<%[mynick]> !bhangra ||") --
user:SendData("$UserCommand 1 3 "..sMenu.."\\Singles\\$<%[mynick]> !singles ||") --
user:SendData("$UserCommand 1 3 "..sMenu.."\\Bollywood Music\\$<%[mynick]> !bmusic ||")

need  to restart scripts    and    reconect  to hub  to  see the  changes

 8)
Title:
Post by: Millsy on 21 August, 2004, 22:38:43
how do u add a command so its only for masters

Later,
Millsy
Title:
Post by: slik_jatt on 21 August, 2004, 23:02:28
damn, didnt work :(..

this is what i seee

(http://www.geocities.com/jattfusion/menutab.JPG)


jus the slashes , nothing else and what i want is somethin like this as u see in windows... or with any menus they branch offf..
see the system tools , menu braches offf....


(http://www.geocities.com/jattfusion/menutab2.JPG)
Title:
Post by: nErBoS on 21 August, 2004, 23:08:26
Hi,

You are using a old version from DC try to get the newest to have the menu showed.

Best regards, nErBoS
Title:
Post by: slik_jatt on 22 August, 2004, 21:13:25
wats the new one thats out,... and isnt it true that the new one takes lot of pc usage?
Title:
Post by: nErBoS on 23 August, 2004, 00:00:50
Hi,

I belive that from Dc++ 0.401 the menu is avaible, the last one was 0.4031, but it's a bit unstable i recommend you to use 0.401.

Best regards, nErBoS
Title: my lua of right clicker is not working.... :'(
Post by: decline on 01 February, 2005, 23:02:35
can somebody tell me why this rightclicker.lua can't be loaded in my ptokax ?

my ptokax is telling me this :
*** Error missing profiles, Install the provided profiles.dat that can be found in folder scripts/profiles!

but how can i instal a   .dat ????

i'm beginning to get desperate


excusse me i'ff my englisch sucks cause i'm from holland....

greetz John...aka Decline...
Title:
Post by: bastya_elvtars on 01 February, 2005, 23:08:04
download ptokax from //www.plop.nl for instance then extract the profiles.dat from the compressed rar or zip or whatever to the folder that ptokax.exe resides in.

Or, if you have RoboCop, it has a different profiles.dat packed.

in general, use the profiles.dat that comes with the bot. If there is no profiles.dat, then use the ptokax one.
Title: uyhm...
Post by: decline on 01 February, 2005, 23:46:01
ok i did not understand that sorry my technical englisch sucks-ass
really....
Title:
Post by: bastya_elvtars on 02 February, 2005, 09:39:35
QuoteOriginally posted by decline
ok i did not understand that sorry my technical englisch sucks-ass
really....

No probs. We are corrupted by M$ installing ways ;)
Title:
Post by: decline on 02 February, 2005, 17:01:00
okayyyy the error is gone but so are is the rightmouse click options, not that they worked before......but i have really no idea what i'm doin' wrong..... :(  ?(    
pfff any more tips ....?


greets Decline
Title:
Post by: decline on 02 February, 2005, 23:03:09
should it matter that i use robocop RoboCop V7.0a. ?

i use  that version because the v9 is not working like i want it to
Title:
Post by: bastya_elvtars on 02 February, 2005, 23:17:03
QuoteOriginally posted by decline
should it matter that i use robocop RoboCop V7.0a. ?

i use  that version because the v9 is not working like i want it to

Probably the rightclick for it is a bit outdated. In DC++ 0.403+ clients its changed. Gona seek for what should be changed ASAP.
Title: thanks
Post by: decline on 08 February, 2005, 16:16:55
all thanks for your help
now the Hub is online.. :D .. decline.no-ip.info
but how do i advertise for this hub ? i would like it iff more people came in......

greetz chewy...