Author Topic: Double UserCommands after leaving hub  (Read 1717 times)

0 Members and 1 Guest are viewing this topic.

Offline Shurlock

  • Fulll Member
  • ****
  • Posts: 56
  • Karma: +1/-0
Double UserCommands after leaving hub
« on: 03 October, 2004, 04:57:55 »
Hi all,

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

Code: [Select]
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?

If it's raining and your roof leaks, fix the roof. DON'T try to stop the rain!!

PtokaX forum

Double UserCommands after leaving hub
« on: 03 October, 2004, 04:57:55 »

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #1 on: 03 October, 2004, 05:31:58 »
Do like this.. I based my script on Robocops zRightClicker

Code: [Select]
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
« Last Edit: 03 October, 2004, 07:51:59 by madman »
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline BottledHate

  • Triple Ace
  • **
  • Posts: 244
  • Karma: +2/-0
(No subject)
« Reply #2 on: 03 October, 2004, 05:35:22 »
check out the dc++ wiki on the right click commands....
if you send the command to clear first, it will eliminate that
problem.


-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

Offline Shurlock

  • Fulll Member
  • ****
  • Posts: 56
  • Karma: +1/-0
(No subject)
« Reply #3 on: 03 October, 2004, 12:58:32 »
Thanks for the pointer BH, works perfect!  :]
If it's raining and your roof leaks, fix the roof. DON'T try to stop the rain!!

Offline HaArD

  • Double Ace
  • *
  • Posts: 104
  • Karma: +2/-1
(No subject)
« Reply #4 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)

PtokaX forum

(No subject)
« Reply #4 on: 03 October, 2004, 18:09:26 »