Khisanth wrote:You can't call functions directly, you can only specific commands to run.
Khisanth wrote: If those commands are created a script you can obvious call get_info and get_context.
Khisanth wrote: If it's a User Command then you can setup the command to pass %c
Thanks for your time.Khisanth wrote:xchat.command('MENU ADD "$CHAN/Bookmark" "myfunction" ') executes a command, it does not create one. Commands are created with hook_command
Khisanth wrote:Then you can use xchat.get_info( "channel" ) inside the callback for hook_command as I mentioned originally
def doBookmark(word, word_eol, userdata):
xchat.prnt("xchat.get_info('channel') = %s" % xchat.get_info("channel"))
return xchat.EAT_ALL
xchat.command('MENU ADD "$CHAN/Bookmark" BOOKMARK')
xchat.hook_command("BOOKMARK", doBookmark)dash9 wrote:How can I obtain, in doBookmark() the name of the channel which has been right-clicked by the user?
def doBookmark(word, word_eol, userdata):
channel = word[1]
xchat.prnt(channel)
return xchat.EAT_ALL
xchat.command('MENU ADD "$CHAN/Bookmark" "BOOKMARK %s"')
xchat.hook_command("BOOKMARK", doBookmark)Users browsing this forum: No registered users and 1 guest