/beep and other notices?

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Consilium
Contributing Member
Contributing Member
Posts: 100
Joined: Wed Oct 02, 2002 10:42 pm

/beep and other notices?

Post by Consilium » Mon Sep 08, 2003 12:57 am

Hi.. I recently came back and submerged myself in some macro creation.

I have some macros that run unattended... well I realize that this is frowned upon. I am in the room just not sitting at my desk. I have a loop atm where if it errors and the error is unfixable it enters a:

Code: Select all

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub HumanFixLoop
   :FixLoop
	/beep
	/delay 25
	/goto :FixLoop 		

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I then am alerted and I fix the error. But I have noticed that isnt all that loud. Is there a way for me to use the eq mp3 player?

Or perhaps even some functions that could execute some sort of alarm program. I have programs now that if invoked via a dos prompt with an initial command it will start an alarm like c:/alarm.exe playnow

I am currently at school and not able to try this myself just wanted to bounce some ideas off the community. I am fairly proficient with the macro language just not aware of all that is possible.

anyway... cheers- back to work.

PS I should state that I do know that I can route my system speaker through my soundcard with some small modifications but I would rather not do this as it seems like a workaround and not a fix.

EDIT : strange how the code option on this board doesnt show my indents correctly for that code.. oh well
Last edited by Consilium on Mon Sep 08, 2003 1:24 am, edited 1 time in total.
-SH
+Student
digitalsavior.com

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Mon Sep 08, 2003 1:02 am

I've never used the EQ mp3 player... it doesn't have /commands built in?
- Plazmic

Consilium
Contributing Member
Contributing Member
Posts: 100
Joined: Wed Oct 02, 2002 10:42 pm

invokeing other proggies

Post by Consilium » Mon Sep 08, 2003 1:08 am

A little more investigation on my part has shown that /mp3 starts with default playlist which will work or alt + k. But really I am interested in more lol... can I invoke other programs with MQ?
-SH
+Student
digitalsavior.com

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Mon Sep 08, 2003 6:14 am

You would have to compile with PERL enabled, and use MQ to invoke a PERL script to invoke an external program.
MQ2: Think of it as Evolution in action.

Consilium
Contributing Member
Contributing Member
Posts: 100
Joined: Wed Oct 02, 2002 10:42 pm

wow

Post by Consilium » Tue Sep 09, 2003 6:38 am

OK.. thank you. Now that gets me somewhere.... does anyone have examples of some perl code used in MQ?
-SH
+Student
digitalsavior.com

Alisandra
orc pawn
orc pawn
Posts: 28
Joined: Fri Aug 30, 2002 9:55 pm

Post by Alisandra » Mon Sep 22, 2003 10:15 pm

You can use the internal mp3 player with two caveats. The first is that you have to know the length of the mp3 file you want to play, otherwise it will end up playing all the mp3s. The second is that you have to play sounds by playlist position. Attached is what I use in my scripts.

Code: Select all

sub InitSounds 
  /mp3 clear

  | Jungle-Windows-Start.wav -- 5 seconds
  /mp3 add x:\Sounds\Alert.wav

  | -- 3 seconds
  /mp3 add x:\Sounds\Danger.wav 

  | Musica-Asterisk.wav -- 1.5 seconds
  /mp3 add x:\Sounds\Message.wav

  | Utopia-Asterisk.wav -- 2 seconds?
  /mp3 add x:\Sounds\Utopia-Asterisk.wav
	
  /return


sub PlaySound
  /if $p0=="Tell" { 
    /mp3 play 3
    /delay 15
    /mp3 stop
  } else /if $p0=="Tell2" { 
    /mp3 play 4
    /delay 2s
    /mp3 stop
  } else /if $p0=="Alert" {
    /mp3 play 1
    /delay 5s
    /mp3 stop
  } else /if $p0=="Danger" {
    /mp3 play 2
    /delay 3s
    /mp3 stop
  }
  
  /return

Consilium
Contributing Member
Contributing Member
Posts: 100
Joined: Wed Oct 02, 2002 10:42 pm

WOw great...also I updated this

Post by Consilium » Thu Oct 09, 2003 2:25 am

Wow fantastic.. thank you.

Code: Select all

sub InitSounds 
  /mp3 clear 

  | Jungle-Windows-Start.wav -- 5 seconds 
  /mp3 add x:\Sounds\Alert.wav 

  | -- 3 seconds 
  /mp3 add x:\Sounds\Danger.wav 

  | Musica-Asterisk.wav -- 1.5 seconds 
  /mp3 add x:\Sounds\Message.wav 

  | Utopia-Asterisk.wav -- 2 seconds? 
  /mp3 add x:\Sounds\Utopia-Asterisk.wav 
    
  /return 


sub PlaySound 
  /if @Param0=="Tell" { 
    /mp3 play 3 
    /delay 15 
    /mp3 stop 
  } else /if @Param0=="Tell2" { 
    /mp3 play 4 
    /delay 2s 
    /mp3 stop 
  } else /if @Param0=="Alert" { 
    /mp3 play 1 
    /delay 5s 
    /mp3 stop 
  } else /if @Param0=="Danger" { 
    /mp3 play 2 
    /delay 3s 
    /mp3 stop 
  } 
  
  /return 
-SH
+Student
digitalsavior.com

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Thu Oct 09, 2003 9:15 am

Does preparing the MP3 player cause the MP3 window to pop up? If it doesn't, why don't you use #defines at the top of your script for the MP3 name and use /mp3 clear, /mp3 add 1 DEFINENAME, /mp3 play. Unless the MP3 automatically repeats the playlist (which it might), that would let you play one song at a time without knowing the duration of a given song.

Alisandra
orc pawn
orc pawn
Posts: 28
Joined: Fri Aug 30, 2002 9:55 pm

Post by Alisandra » Thu Oct 09, 2003 12:33 pm

Unfortunately it does repeat ad infinitum, and there doesnt seem to be a switch for that behaviour.