PtokaX forum

Archive => Archived 5.1 boards => HOW-TO's => Topic started by: ((KMN))Gazza-95 on 25 July, 2006, 21:39:00

Title: right click
Post by: ((KMN))Gazza-95 on 25 July, 2006, 21:39:00
how do u add a right click function i lua 5.1

plz help
Title: Re: right click
Post by: bastya_elvtars on 25 July, 2006, 21:52:37
http://www.dcpp.net/wiki/index.php/%24UserCommand

Sending raw data to users is the PX-specific part :)
Title: Re: right click
Post by: ((KMN))Gazza-95 on 25 July, 2006, 21:58:25
thx m8
Title: Re: right click
Post by: bastya_elvtars on 25 July, 2006, 21:59:31
If you search the forum, you will find a discussion on this here (IIRC).
Title: Re: right click
Post by: ((KMN))Gazza-95 on 25 July, 2006, 22:01:10
soory m8 i dint make it clear enough my mestak i men what is the function to add a right click command into a script

sorry m8 my bad
Title: Re: right click
Post by: bastya_elvtars on 25 July, 2006, 22:04:49
user:SendData("$UserCommand 1 3 Help$!help|")
Title: Re: right click
Post by: ((KMN))Gazza-95 on 30 July, 2006, 21:26:58
thx m8 i will try it
Posted on: 2006-07-25, 23:16:38
i cant ger it to work
Title: Re: right click
Post by: bastya_elvtars on 30 July, 2006, 21:28:02
Quote from: ((KMN))Gazza-95 on 30 July, 2006, 21:26:58
i cant ger it to work


Post what you are having.
Title: Re: right click
Post by: Psycho_Chihuahua on 31 July, 2006, 15:17:18
well try something more like this
function NewUserConnected(user)
user:SendData("$UserCommand 1 3 Help$!help|")
end

OpConnected = NewUserConnected
Title: Re: right click
Post by: bastya_elvtars on 07 August, 2006, 19:59:34
Cannot help write-only users, sorry. :-P
Title: Re: right click
Post by: ((KMN))Gazza-95 on 07 August, 2006, 22:57:02
thx all i eventually got it working

thx again
Title: Re: right click
Post by: bastya_elvtars on 08 August, 2006, 15:05:26
Quote from: ((KMN))Gazza-95 on 07 August, 2006, 22:57:02
thx all i eventually got it working

thx again

Care to share your work with us?
Title: Re: right click
Post by: ((KMN))Gazza-95 on 08 August, 2006, 22:04:18
not finished yet m8 lol soz but will wen finished kk
Title: Re: right click
Post by: The_ArchitecT on 21 September, 2006, 18:34:18
function NewUserConnected(user)
user:SendData("$UserCommand 1 3 Help$<[%mynick]>!help&#124;")
end

OpConnected = NewUserConnected


<[%mynick]>  indicates that the command is coming from you

i.e. if my nick is Billy, then the result, when I type !help would normally be shown as <Billy> !help in the hub...
Title: Re: right click
Post by: speedX on 05 October, 2006, 23:14:22

function NewUserConnected(user)
   user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart#124;|")
end


i made this right click for my trivia script.....ut works fine but after clicking on it....i have type some thing in main chat....thn only it shows trivia started by speedX......adn the game starts....wat error is there??
Title: Re: right click
Post by: Thor on 05 October, 2006, 23:55:14
Use this format:
function NewUserConnected(user)
   user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
end

So not two endpipe, first will be &#124;
Btw: http://dcpp.net/wiki/index.php/%24UserCommand
Title: Re: right click
Post by: speedX on 06 October, 2006, 10:42:17
thank u guys...1 last request...
Quote
function NewUserConnected(user)
   user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
end

OpConnected = NewUserConnected

i want to add one right click only for ops and masters.... i.e
Quote
user:SendData("$UserCommand 1 3 Registration\\Add User$<%[mynick]> !addreguser %[line:Nick] %[line:Pass] Reg&#124;")

Where and how to put this command???


Title: Re: right click
Post by: 6Marilyn6Manson6 on 06 October, 2006, 11:50:19
Quote from: speedX on 06 October, 2006, 10:42:17
thank u guys...1 last request...
i want to add one right click only for ops and masters.... i.e
Where and how to put this command???




Change:

function NewUserConnected(user)
   user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
end

OpConnected = NewUserConnected


with:

function NewUserConnected(user)
user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
end

function OpConnected(user)
if user.bOperator and (user.iProfile ==  0 or user.iProfile ==  1) then
user:SendData("$UserCommand 1 3 Registration\\Add User$<%[mynick]> !addreguser %[line:Nick] %[line:Pass] Reg&#124;")
user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
end
end


C ya
Title: Re: right click
Post by: Rincewind on 06 October, 2006, 18:26:06
Quote from: 6Marilyn6Manson6 on 06 October, 2006, 11:50:19
Change:

function NewUserConnected(user)
   user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
end

OpConnected = NewUserConnected


with:

function NewUserConnected(user)
user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
end

function OpConnected(user)
if user.bOperator and (user.iProfile ==  0 or user.iProfile ==  1) then
user:SendData("$UserCommand 1 3 Registration\\Add User$<%[mynick]> !addreguser %[line:Nick] %[line:Pass] Reg&#124;")
user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
end
end


C ya
Much better to dofunction NewUserConnected(user)
   user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
   if user.bOperator then
      user:SendData("$UserCommand 1 3 Registration\\Add User$<%[mynick]> !addreguser
   end
end

OpConnected = NewUserConnected

Title: Re: right click
Post by: 6Marilyn6Manson6 on 07 October, 2006, 09:01:26
Quote from: Rincewind on 06 October, 2006, 18:26:06
Much better to dofunction NewUserConnected(user)
   user:SendData("$UserCommand 1 3 Triva\\Start Trivia$<%[mynick]> !trivstart&#124;|")
   if user.bOperator then
      user:SendData("$UserCommand 1 3 Registration\\Add User$<%[mynick]> !addreguser
   end
end

OpConnected = NewUserConnected



Mmm I agree  ;D
Title: Re: right click
Post by: speedX on 07 October, 2006, 16:44:14
Hi guys...
Quote
   user:SendData("$UserCommand 1 3 HOPS\\IP Help\\Nick From IP$<%[mynick]> +ip %[line:IP]&#124;|")
   user:SendData("$UserCommand 0 3 ")
   user:SendData("$UserCommand 1 3 HOPS\\Alerts\\Add Alert$<%[mynick]> +addalert %[line:nick]&#124;|")

I would like a separator between IP help and Alerts......but the codes wich i have entered makes a separator after Nick frm IP.....wat is the error ??  i tried to go through the link above.......but didn get it.....plzzz help...
Title: Re: right click
Post by: Rincewind on 07 October, 2006, 17:28:08
I believe the separator would be curUser:SendData("$UserCommand 0 3 |")
Give that a try and let me know how you get on
Title: Re: right click
Post by: speedX on 07 October, 2006, 18:08:12
nope not workin......it is showing me the following error....

Syntax ...PtokaX & Scripts\test 0.3.5.1\scripts\rightclick.lua:12: attempt to index global 'curUser' (a nil value)
Title: Re: right click
Post by: Herodes on 07 October, 2006, 18:15:54
Quote from: speedX on 07 October, 2006, 18:08:12
nope not workin......it is showing me the following error....

Syntax ...PtokaX & Scripts\test 0.3.5.1\scripts\rightclick.lua:12: attempt to index global 'curUser' (a nil value)

what is the script you are running,..?
Because as I searched the thread I didn't find 'curUser' anywhere,
I assume that you copy-pasted some code.
Post up the script that you are trying to code in the developing problems forums (look at the board index.)
Title: Re: right click
Post by: speedX on 07 October, 2006, 19:26:17
no....it is not a script or thread......i am just making my own right.....first i disable teh right click of all my scripts and thn cuztomizing my own right click.......in making my own right click i faced a porb while making a separator.......read my above post.....
Title: Re: right click
Post by: Herodes on 07 October, 2006, 19:35:48
Quote from: speedX on 07 October, 2006, 19:26:17
no....it is not a script or thread......i am just making my own right.....first i disable teh right click of all my scripts and thn cuztomizing my own right click.......in making my own right click i faced a porb while making a separator.......read my above post.....
yeap I noticed ;) nice to see you doing some stuff on your own :P

I just now saw the post from Rincewind
try changing the curUser to user ;o
Title: Re: right click
Post by: Rincewind on 07 October, 2006, 20:29:12
Sorry that was me not paying attenton to the variable names
Title: Re: right click
Post by: speedX on 07 October, 2006, 20:53:52
hm.....so i guess tht my request is not possible to fulfill  :(
Title: Re: right click
Post by: Rincewind on 07 October, 2006, 21:30:26
as Herodes said change the curUser in the line I supplied to user and the separator should then work
Title: Re: right click
Post by: speedX on 07 October, 2006, 21:37:18
The separator is working....but it is shoing the separator after Nick of IP.....I would like a separator between IP help and Alerts.........is it possible?? and i tried both curuser and user but still the separator comes after Nick from IP.....
Title: Re: right click
Post by: Rincewind on 07 October, 2006, 21:53:09
Is the code you have this;user:SendData("$UserCommand 1 3 HOPS\\IP Help\\Nick From IP$<%[mynick]> +ip %[line:IP]&#124;")
user:SendData("$UserCommand 0 3 &#124;")
user:SendData("$UserCommand 1 3 HOPS\\Alerts\\Add Alert$<%[mynick]> +addalert %[line:nick]&#124;")
Title: Re: right click
Post by: speedX on 07 October, 2006, 21:58:06
nope I m using this code...

   user:SendData("$UserCommand 1 3 HOPS\\IP Help\\Nick From IP$<%[mynick]> +ip %[line:IP]&#124;|")
   user:SendData("$UserCommand 0 3 ")
   user:SendData("$UserCommand 1 3 HOPS\\Alerts\\Add Alert$<%[mynick]> +addalert %[line:nick]&#124;|")


But i tried ur code also....not workin as per my request... :(  the separator is still coming after Nick from IP
Title: Re: right click
Post by: Herodes on 07 October, 2006, 22:19:05
it is impossible.. resistance is futile.

try making it without the sub-menus.. it'll work ;)

user:SendData("$UserCommand 1 3 HOPS\\IP Help - Nick From IP$<%[mynick]> +ip %[line:IP]&#124;|")
user:SendData("$UserCommand 0 3 ")
user:SendData("$UserCommand 1 3 HOPS\\Alerts - Add Alert$<%[mynick]> +addalert %[line:nick]&#124;|")


Probably the separator can be added only for just until one sub menu. no more. ( I don't know if its meant to work this way in the client, if not then its a bug that will not be fixed since the DC++ creators are going to remove all NMDC Protocol from the DC++ sooner than we can all imagine... )
Title: Re: right click
Post by: speedX on 07 October, 2006, 22:33:27
ya even i knew it tht it would be impossible......but thought i shud once ask u all...... np
Title: Re: right click
Post by: Psycho_Chihuahua on 07 October, 2006, 22:43:58
well i've been playing around a bit and this bit works for me

user:SendData("$UserCommand 1 3 HOPS\\IP Help - Nick From IP$<%[mynick]> +ip %[line:IP]&#124;");
user:SendData("$UserCommand 0 3 ");
user:SendData("$UserCommand 1 3 HOPS\\Alerts - Add Alert$<%[mynick]> +addalert %[line:nick]&#124;");


either that way or this way

user:SendData("$UserCommand 1 3 HOPS\\IP Help\\Nick From IP$<%[mynick]> +ip %[line:IP]&#124;");
user:SendData("$UserCommand 0 3 ");
user:SendData("$UserCommand 1 3 HOPS\\Alerts\\Add Alert$<%[mynick]> +addalert %[line:nick]&#124;");
Title: Re: right click
Post by: Rincewind on 07 October, 2006, 23:04:03
Yeah sorry I was forgetting about rhe submenus  :P

The separator will appear at the bottom of the previous submneu rather than ijn the top level. As far as I know there is no way round that
Title: Re: right click
Post by: speedX on 07 October, 2006, 23:13:26
hm......unfortunately the 2nd one is not working for me......would not like if it is displayed like the first one.......
Title: Re: right click
Post by: Psycho_Chihuahua on 07 October, 2006, 23:45:59
what client are you using?

like i said they both work for me and i'm using CZDC 0.666[P2]
Title: Re: right click
Post by: speedX on 08 October, 2006, 07:42:50
i m using Strong DC 1 rc10