mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Jul 2006
Posts: 3,962
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,962
Your current code:
Code
spoton {
  var %status $dll(data\dll\spoton\spoton.dll,status,)
  if (%status == 1) echo -a Spotify is paused.
  elseif (%status == 2) echo -a Spotify is playing Advertisement.
  elseif (%status == 3) say Spotify » $dll(data\dll\spoton\spoton.dll,song,)
  else echo -a Spotify is not running.
}
is using /say in status 3 (the one for other users to see that interest us) to send a message to the current channel (/spoton will fail if what's considered the active window is not a channel/query/etc window.
To send a message to all channel, there is the /amsg command, so first, you could improve the current /spoton alias by offering a feature to send to all channels (though sending a message to all your channel at the same time can be considered and seen bad/harmful/annoying).
Now, you would need to ask Fernet, but 'multi server' and only sending to the active window don't go together, there's only one active window at a time, for a given server. What would multi server support means here if you don't even have an option to send to all channels?


Anyway, /scon -at1 <command> is a command that can be used to execute a command on all connected server. If you use "/scon -at1 spoton", it will fail.

But you can do:

Code
spoton {
  var %status $dll(data\dll\spoton\spoton.dll,status,)
  if (%status == 1) echo -a Spotify is paused.
  elseif (%status == 2) echo -a Spotify is playing Advertisement.
  elseif (%status == 3) say Spotify » $dll(data\dll\spoton\spoton.dll,song,)
  elseif (%status == 4) amsg Spotify » $dll(data\dll\spoton\spoton.dll,song,)
  elseif (%status == 5) scon -at1 amsg Spotify » $unsafe($dll(data\dll\spoton\spoton.dll,song,))
  else echo -a Spotify is not running.
}
Now 4 = all channels and 5 = all channels on all connected server. $unsafe is required to avoid evaluation problem like was mentioned by maroon and $dll() returning some line feed characters (but this times it's because of /scon that we need it)

If this is not what was meant by OP with 'multi server' support, then he would have to explain what he wants smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2021
Posts: 27
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2021
Posts: 27
%status is a way to detect if Spotify is in a state: 0 - Not running, 1 - Paused, 2 - Advertisement, 3 - Playing. %status does not yet contains 4 or 5.
Everything else looks good. It's just that people would 100% get annoyed/angry if this would write out everywhere. But that's what I think.

Instead of %status 4 and 5. Someone that really want to do a amsg on 1 network or more networks could use a parameter like /spoton [x], if it contains 0 or 1. Send a message to 1 network, if 1 send to all networks. And if not a parameter just send to current window. I know how to detect parameters in aliases. It's just a bit easier to do like this.

I don't really know if I'm going to support mass messages like this in the Lite Script that I have created.

Anyway thanks for the information Wims.

Joined: Jan 2021
Posts: 27
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2021
Posts: 27
I'm sorry to everyone that is waiting for more features for Spoton. I'm still learning me C++ from courses and my knowledge is getting better and better.

From my current knowledges I have fixed several issues in Spoton. So there is a new update, version 1.1.5.

From my testing I have noticed that the DLL-File never free the memory. So it will add more and more data to the memory. So please update to 1.1.5.

Last edited by turbosmurfen; 18/06/22 07:33 PM.
Page 2 of 2 1 2

Link Copied to Clipboard