Signup Now
Results 1 to 8 of 8
  1. #1
    Free User Riku's Avatar
    Join Date
    Nov 2014
    Posts
    365
    Reputation
    49
    Rep Power
    19

    Open New/Custom Channel

    I searched and found some old threads about this, here, here and one that's a little bit off but still in the same discussion here.

    I did not feel like these people expressed what they wanted to do with it
    clear enough so here goes my try to convince you that my suggestion is awesome.



    So we all know this lovely function ingame (CTRL+O) located in the bottom right corner that looks like a folder,
    it opens a little window with all the different channels inside aswell as writeable box that opens a Private Message Channel with the named person.

    New Functions:
    • pmsay(string name, string message, optional boolean openwindow, optional boolean ctrl)
    • openchannel(string channelname, optional boolean ctrl)
    • openpmchannel(string name, optional boolean ctrl)


    Further Explanation:
    • pmsay()
      Will switch focus to the channel name and message an optional message to that channel, optional boolean to open the channel window if one is not already opened (will use *name*[message] otherwise),
      optional boolean to open via CTRL+O or clicking the Folder icon in the bottom right with a mouse click.

    • openchannel()
      Will open a channel (World Chat, English Chat, Advertising, Help, Private Chat Channels, NPCs), optional boolean to open via CTRL+O or clicking the Folder icon in the bottom right with a mouse click.
    • openpmchannel()
      Will open a private message channel with given name, optional boolean to open via CTRL+O or clicking the Folder icon in the bottom right with a mouse click.


    --> Do not edit anything below!
    -- // Riku Scripts >>>>

    init start
    local sendToPlayer = "Lucas Terra"
    local seenNames = {$name}
    init end

    auto(1000)

    foreach creature m 'ps' do
    if (not table.find(seenNames, m.name)) then
    if ischannel(sendToPlayer) then
    pmsay(sendToPlayer, "New Player in my screen.", true, true)
    wait(3000, 5000)
    table.insert(seenNames, m.name)
    else
    pmsay(sendToPlayer, "New Player in my screen.", false, true)
    wait(3000, 5000)
    table.insert(seenNames, m.name)
    end
    end
    end


    What is there not to love? If you need further explanations or ideas then tell me. It could be used for countless ideas.
    Last edited by Riku; 02-23-2015 at 07:08 PM.

  2. #2
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Normally, I'd be bashing about how you're wasting everyone's time creating another thread with something that has already been suggested, but you did it so well, specially when compared to the other threads that, actually, I'm not even mad, that's amazing. I wish we had more suggestion threads like this one.

    If we ever implement this, I'd like to see say() and npcsay() having the same optional parameters as the proposed pmsay(). One thing to consider, though, is what the default values for the optional booleans should be. Personally, I'd prefer a default of true for openwindow and false for usectrl, since that seems to be the desired behavior for the majority of the use cases.

    That being said, as you pointed out in your explanation for pmsay(), this functionality can already be achieved by calling say('*<name>* message'), so I don't think we'll be prioritizing this now.

  3. #3
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    function pmsay(name, msg)
    if ischannel(name) then
    return say(name, msg)
    end

    return say(sprintf("*%s* %s", name, msg))
    end


    This deals with everything you need, I guess. And openchannel is not so necessary, as the main channels are kept opened after you log off.

  4. #4
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Quote Originally Posted by Leonardo View Post
    function pmsay(name, msg)
    if ischannel(name) then
    return say(name, msg)
    end

    return say(sprintf("*%s* %s", name, msg))
    end


    This deals with everything you need, I guess. And openchannel is not so necessary, as the main channels are kept opened after you log off.
    That actually fucks up for long names, as they get cropped in the chat window name.

  5. #5
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by Raphael View Post
    That actually fucks up for long names, as they get cropped in the chat window name.
    I didn't know if ischannel could deal with that by itself or not, so I let it right as it's, but the 'name' can be cropped as a string too if you know the maximum channel name's length.

    edit:

    Thinking about it again: it wouldn't fuck up, for example:

    ischannel("Cavaleiro Lendario of Luminera") would return false even with channel "Cavaleiro len..." opened, and it would skip this step.
    Last edited by Leonardo; 01-07-2015 at 04:03 PM.

  6. #6
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Quote Originally Posted by Leonardo View Post
    I didn't know if ischannel could deal with that by itself or not, so I let it right as it's, but the 'name' can be cropped as a string too if you know the maximum channel name's length.

    edit:

    Thinking about it again: it wouldn't fuck up, for example:

    ischannel("Cavaleiro Lendario of Luminera") would return false even with channel "Cavaleiro len..." opened, and it would skip this step.
    Ye, I'm sorry, it wouldn't "fuck up", but it wouldn't be as efficient as it could.
    No, ischannel can't handle the cropped names.
    Yes, you could account for the cropping if you knew the correct length, I was just reminding you of that.

  7. #7
    Free User Riku's Avatar
    Join Date
    Nov 2014
    Posts
    365
    Reputation
    49
    Rep Power
    19
    Quote Originally Posted by Raphael View Post
    Normally, I'd be bashing about how you're wasting everyone's time creating another thread with something that has already been suggested, but you did it so well, specially when compared to the other threads that, actually, I'm not even mad, that's amazing. I wish we had more suggestion threads like this one.

    If we ever implement this, I'd like to see say() and npcsay() having the same optional parameters as the proposed pmsay(). One thing to consider, though, is what the default values for the optional booleans should be. Personally, I'd prefer a default of true for openwindow and false for usectrl, since that seems to be the desired behavior for the majority of the use cases.

    That being said, as you pointed out in your explanation for pmsay(), this functionality can already be achieved by calling say('*<name>* message'), so I don't think we'll be prioritizing this now.
    Speechless about this reply. Thank you very much and for the linking in the Suggestions Posting Guidelines!


    Quote Originally Posted by Leonardo View Post
    This deals with everything you need, I guess. And openchannel is not so necessary, as the main channels are kept opened after you log off.
    Well, yeah I guess it does but I'm a fan of simplicity aka not filling every script I have with homebrewed functions everywhere, i'm stubborn and will say this still doesn't deal with everything I need, it's just a patch on my flesh wound. But thanks a lot for your effort! Will be using that until my ideas get implemented, if they actually do.

    I was also thinking about some focuschannel(channelname) command also that switches focus to a certain channel. Nothing of everything i've proposed is necesarrily needed for WindBot, it's just some small details I personally would like to see implemented and would definitely have a lot of fun mixing together scripts with those functions!

  8. #8
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by aZe View Post
    Well, yeah I guess it does but I'm a fan of simplicity aka not filling every script I have with homebrewed functions everywhere, i'm stubborn and will say this still doesn't deal with everything I need, it's just a patch on my flesh wound. But thanks a lot for your effort! Will be using that until my ideas get implemented, if they actually do.

    I was also thinking about some focuschannel(channelname) command also that switches focus to a certain channel. Nothing of everything i've proposed is necesarrily needed for WindBot, it's just some small details I personally would like to see implemented and would definitely have a lot of fun mixing together scripts with those functions!
    I guess that can be "patched" too.

    function focuschannel(channel)
    return say(channel, '')
    end

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •