simple tell script

gp1001

Active Member
Can some one with some scripting knowledge tell wme why this tell.iss doesnt work anymore?

PHP:
#macro ProcessTriggers() 
if "${QueuedCommands}" 
{ 
  do 
  { 
     ExecuteQueued 
  } 
  while "${QueuedCommands}" 
} 
#endmac 

function PlaySound(string Filename) 
{ 
APICall ${System.GetProcAddress["WinMM.dll","PlaySound"].Hex} Filename 0 Math.Dec[22001] 
} 

function main() 
{ 
  AddTrigger Tells "@who@/a tells you,"@what"" 
  do 
  { 
     ProcessTriggers() 
     waitframe 
  } 
  while 1 
} 

function Tells(string Line) 
{ 
  call PlaySound "C:\\program files\\innerspace\\sounds\\PHASER.wav" 
}
 

Amadeus

The Maestro
Staff member
Well, first of all, I would put in some debugging stuff to see exactly where the problem lies. For example, do this:

PHP:
function Tells(string Line)  
{  
  echo TELL RECEIVED!
  call PlaySound "C:\\program files\\innerspace\\sounds\\PHASER.wav"  
}
Then, if you get an echo, you know it's the API call.


My only other thought is that I use a different trigger for getting tells myself, it looks like this:

PHP:
AddTrigger ReceivedTell "\\aPC @*@ @*@:@sender@\\/a tells you,@text@"
 

gp1001

Active Member
This is what i get in the console window:

Code:
TELL RECEIVED!
The APICall command is deprecated and will be removed.  Use System:APICall instead.
Dumping script stack
--------------------
-->C:/Program Files/InnerSpace/Scripts/tell.iss:14 PlaySound() APICall ${System.GetProcAddress["WinMM.dll","PlaySound"].Hex} Filename 0 Math.Dec[22001]
C:/Program Files/InnerSpace/Scripts/tell.iss:31 ReceivedTell() call PlaySound "C:\\Program files\\Innerspace\\Sounds\\PHASER.wav"
C:/Program Files/InnerSpace/Scripts/tell.iss:22 main() ExecuteQueued
So this is my script:

PHP:
#macro ProcessTriggers() 
if "${QueuedCommands}" 
{ 
  do 
  { 
     ExecuteQueued 
  } 
  while "${QueuedCommands}" 
} 
#endmac 

function PlaySound(string Filename) 
{ 
APICall ${System.GetProcAddress["WinMM.dll","PlaySound"].Hex} Filename 0 Math.Dec[22001] 
} 

function main() 
{ 
  AddTrigger ReceivedTell "\\aPC @*@ @*@:@sender@\\/a tells you,@text@" 
  do 
  { 
     ProcessTriggers() 
     waitframe 
  } 
  while 1 
} 

function ReceivedTell(string Line)  
{  
  echo TELL RECEIVED!
  call PlaySound "C:\\Program files\\Innerspace\\Sounds\\PHASER.wav"  
}
I tried to replace the APICall line with:

PHP:
System:APICall ${System.GetProcAddress["WinMM.dll","PlaySound"].Hex} Filename 0 Math.Dec[22001]
And i get this error:

Code:
No such 'system' method 'APICall 76b5a8f7 Filename 0 Math'
Error parsing data sequence '.Dec[22001]'
Dumping script stack
--------------------
-->C:/Program Files/InnerSpace/Scripts/tell.iss:14 PlaySound() System:APICall ${System.GetProcAddress["WinMM.dll","PlaySound"].Hex} Filename 0 Math.Dec[22001
C:/Program Files/InnerSpace/Scripts/tell.iss:31 ReceivedTell() call PlaySound "C:\\Program files\\Innerspace\\Sounds\\PHASER.wav"
C:/Program Files/InnerSpace/Scripts/tell.iss:22 main() ExecuteQueued
 
Last edited:

Hendrix

Well-Known Member
Wow, after reading through more logs I see that you chatted with lax about the problem, and he told you what you needed to do...

lax said:
when you give up, heres your cheat sheet. System:APICall[${System.GetProcAddress[WinMM.dll,PlaySound].Hex},Filename.String,0,"Math.Dec[22001]"]
original post said:
Code:
[13:14] 14[~@Lax14] because Filename is a mutablestring, which changed.
[13:14] 14[~@Lax14] mutablestring is now utf8string*
[13:14] 14[~@Lax14] i need to add a member to mutablestring to get the char* for that to work right
[13:15] 14[~@Lax14] lol ok i have a way for you to do it
[13:15] 14[Twiddle14] o_O
[13:15] 14[~@Lax14] APICall ${System.GetProcAddress["WinMM.dll","PlaySound"].Hex} Filename.Replace[a,a] 0 Math.Dec[22001]
[13:15] 14[~@Lax14] temporary workaround until i add something proper to mutablestring :)
[13:16] 14[Twiddle14] Alrighty, haha
[13:16] 14[Valerian14] eww, that's ugly Lax ;)
[13:16] * Valerian pees on .Replace[a,a]
[13:16] 14[~@Lax14] hehehe
[13:16] 14[~@Lax14] yeah it is ugly
[13:17] 14[~@Lax14] BUT it gets you the unchanged string object ;)
 
Last edited:

gp1001

Active Member
Hendrix said:
Wow, after reading through more logs I see that you chatted with lax about the problem, and he told you what you needed to do...

Yep, Lax is the man!
I will post this script in the script thread.
 

Hendrix

Well-Known Member
just so you know..

Code:
call PlaySound "C:\\program files\\innerspace\\sounds\\intercom.wav"
should be...

Code:
call PlaySound "${LavishScript.CurrentDirectory}/sounds/intercom.wav"
you can't hard code the path because not everyone uses the default IS directory.
 

gp1001

Active Member
Hendrix said:
just so you know..

Code:
call PlaySound "C:\\program files\\innerspace\\sounds\\intercom.wav"
should be...

Code:
call PlaySound "${LavishScript.CurrentDirectory}/sounds/intercom.wav"
you can't hard code the path because not everyone uses the default IS directory.
Awsome, Thanks!
 

Multicharacter

Senior Member
Here's one I was working on but it never got to the point I felt comfortable releasing it and supporting any problems people might have with it. It works though, so maybe you can get a few ideas from it for yours. Yeah, my code is a mess, but I'd cleaned it up if I ever got it to the point I considered it worthy of official release. Only part that really needs editting (entirely up to you) is under TellReceived it first chooses that if the tell contains certain words it ignores it, and if the tell comes from certain people it ignores it. That's good to filter out those annoying beyond belief people that spam you everyday trying to sell you gold for that site with very bad english. I never could test the WOW part of it.

Code:
function main()
{
if ${Game.Name.Equal[Everquest II]}
	{
	call EQ2
	}
if ${Game.Name.Equal[World of Warcraft]}
	{
	call WoW
	}
}

function EQ2()
{
extension -require isxeq2
declare PlayTellSnd global 0
squelch bind endchatrelay F12 "endscript chatrelay"
AddTrigger TellRecieved "\\aPC @*@ @*@:@sender@\\/a tells you@*@@*@"
AddTrigger TellRecieved "\\aPC @*@ @*@:@sender@\\/a says,@*@@*@"
AddTrigger TellRecieved "\\aPC @*@ @*@:@sender@\\/a say,@*@@*@"

do
{
	if ${PlayTellSnd}>0
	{
	
	call PlaySound "IncomingChat.wav"
	PlayTellSnd:Set[0]
	}
call ProcessTriggers
}
while 1
}

function TellRecieved(string Line, string sender)
{
call LightWindow
if ${Line.Find[annoyinggoldseller]} || ${Line.Find[cometomysite]}
{
return
}
if ${sender.Equal[ignoreplayer1]} || ${sender.Equal[ignoreplayer2]}
	{
	return
	}
EQ2Echo Tell Recieved from ${sender}
call PlaySound "IncomingChat.wav"
wait 1
relay all PlayTellSnd:Set[1]
wait 5
relay all echo Tell directed at ${Me}: ${Line}
wait 5
relay all EQ2Echo Tell directed at ${Me}: "${Line}" -chattype gsay 
}

function PlaySound(string Filename) 
{ 
;Play Sound
System:APICall[${System.GetProcAddress["WinMM.dll","PlaySound"].Hex},Filename.String,0,Math.Dec[22001\]] 
}

function ProcessTriggers() 
{
	if "${QueuedCommands}" 
	{
		do 
		{
			ExecuteQueued 
		}
		while "${QueuedCommands}"
	}
}

function LightWindow()
{
Display.Window:Flash
}

function LightWindowDeprecated()
{
; Make the window that received the tell light up.
declare handle int script 0
declare window string script "is1 (Ctrl+Alt+1)"`
System:APICall[${System.GetProcAddress["user32.dll","FindWindowA"].Hex},0,window]
handle:Set[${APIReturn}]
System:APICall[${System.GetProcAddress["user32.dll","FlashWindow"].Hex},${handle},0]
deletevariable handle
deletevariable window
}

function WoW()
{
extension -require isxWoW
declare PlayTellSnd global 0
squelch bind endstartstop F12 "endscript chatrelay"
; Trigger for say - from WoW wiki
AddTrigger TellReceivedWoW "[Event:@eventid@:CHAT_MSG_SAY] (\"@message@\",\"@speaker@\",\"@language@\",\"@something@\",\"@something@\",\"@something@\",@something@,@something@,\"@something@\",@something@)"
; Trigger for whispers from WoW wiki
AddTrigger TellReceivedWoW "[Event:@eventid@:CHAT_MSG_WHISPER](\"@message@\",\"@speaker@\",\"@language@\",\"@something@\",\"@something@\",\"@something@\",@something@,@something@,\"@something@\",@something@)"

do
{
	if ${PlayTellSnd}>0
	{
	call LightWindow
	call PlaySound "IncomingChat.wav"
	PlayTellSnd:Set[0]
	}
call ProcessTriggers
}
while 1
}

function TellRecievedWoW(string Line, string sender)
{
WoWEcho Tell Recieved from ${sender}
call PlaySound "IncomingChat.wav"
wait 1
uplink relay all PlayTellSnd:Set[1]
wait 5
Uplink Relay all WoWEcho Tell received for ${Me}: ${Line}
}
 
Top Bottom