PtokaX forum

Development Section => Your Developing Problems => Topic started by: Shurlock on 03 October, 2004, 04:57:55

Title: Double UserCommands after leaving hub
Post by: Shurlock on 03 October, 2004, 04:57:55
Hi all,

I have a problem with sending 'right click' UserCommands.

function NewUserConnected(user)
    if not (user.bOperator) then
user:SendData("$UserCommand 1 3 Help\\English$<%[mynick]> !help||")
user:SendData("$UserCommand 1 3 Help\\French$<%[mynick]> !frhelp||")
user:SendData("$UserCommand 1 3 Help\\Hungarian$<%[mynick]> !frhelp||")
user:SendData("$UserCommand 1 3 Help\\Italian$<%[mynick]> !frhelp||")
user:SendData("$UserCommand 1 3 Help\\Spanish$<%[mynick]> !frhelp||")
    end
end

All is well and works well, untill a user re-enters the hub without restarting the client .
At that moment all the UserCommands will appear twice in the right click menu. The more often he/she re-enters, the longer the list gets.

Is there a way to find out at login if the UserCommands were already loaded?

Title:
Post by: Madman on 03 October, 2004, 05:31:58
Do like this.. I based my script on Robocops zRightClicker

function NewUserConnected(user)
user:SendData(" Enhanced Right Click Support For Your Own Good Is Available!")
--//Users
if (user.iProfile == -1) then
UserCustomCMDs(user)
end
end

function UserCustomCMDs(user)
user:SendData("$UserCommand 1 3 Users\\Rules$<%[mynick]> !rules||")
user:SendData("$UserCommand 1 3 Users\\Network$<%[mynick]> !network||")
end
Title:
Post by: BottledHate on 03 October, 2004, 05:35:22
check out the dc++ wiki (http://dcplusplus.sourceforge.net/wiki/index.php/UserCommand%20command) on the right click commands....
if you send the command to clear first, it will eliminate that
problem.


-BH
Title:
Post by: Shurlock on 03 October, 2004, 12:58:32
Thanks for the pointer BH, works perfect!  :]
Title:
Post by: HaArD on 03 October, 2004, 18:09:26
Sending

$UserCommand 255 7

as the first UserCommand will solve it... but this was a bug in DC++ which has been fixed in .4033

-- 0.4033 2004-09-27 --
* Fixed dupe usercommands on reconnect (thanks sed)