mIRC Homepage
Posted By: DiMTRX Need some help - 12/01/05 11:56 AM
At the moment i got this part of scripting for when im not around and someone calls my nick.

Code:
on *:text:$($+(*,$me,*)):#:{ if $chan != $active { echo 14 -a 4[Nick Call]7 $nick in7 $chan said: $1- } }


But i was wondering if i could implement some sort of code that for when im CS'ing or playing some other game a.k.a when i can't see the mIRC windows my MSagent speaks the line wich contains my nick.

Codes for loading the MSagent etc are below:

Code:
/gload Mike Mike.acs
//gtalk Nick Call: $nick in $chan said: $1-


Don't know if there is a way to use them both, cause when im not gaming for example i don't want the agent to continuesly speak the text. Any of you bright scripters that can give me a helping hand with this ?

Thankz in Advance

Btw my nick is ]x[, so thats why the code my look a bit strange blush
Posted By: SladeKraven Re: Need some help - 12/01/05 12:01 PM
Code:
on 1:TEXT:$(* $+ $me $+ *):*: {
  if ($chan != $active) { 
    echo 14 -a 4[Nick Call]7 $nick in7 $chan said: $1-
  }
  if (!$appactive) {
    gload Mike Mike.acs
    gtalk Nick Call: $nick in $chan said: $1-
  }
}
Posted By: DiMTRX Re: Need some help - 12/01/05 12:08 PM
So the !$appactive variable is not $true when im playing other games right or am i mistaken here, and thus is loads the agent ?
Posted By: SladeKraven Re: Need some help - 12/01/05 12:10 PM
You're correct. Only it's an identifier not a variable. When your name is being called on a channel where mIRC is not $appactive (the active application). It will load the agent for you etc.

Hope this helps.
Posted By: LethPhaos Re: Need some help - 12/01/05 12:14 PM
Can you also make it echo this way when a highlight has been done? Not only when anybody sais your nick but also when a word said is in your highlight list.
Is that possible?
Posted By: SladeKraven Re: Need some help - 12/01/05 12:33 PM
I'm not too hot on the Highlight Feature, truth be told I've never actually used it. blush

Is this what you mean
Code:
on 1:TEXT:$(* $+ $highlight($1-) $+ *):#: {
  commands..
}
Posted By: DiMTRX Re: Need some help - 12/01/05 12:40 PM
Hmmmz the following problems have occured mad

Code:
* /gload: 'Mike' (Mike.acs) already loaded (line 64, script.ini)


Shows up in my status window.

When people sent a pm ( if i turn the agent on with private events then it does work just to make that clear ) and im active in that pm, i suddenly get spammed with

Code:
[13:30] [Nick Call] DAFsam in said: ]x[ test message


And when they say the message in the channel then it still doesnt work frown

Any ideas ?
Posted By: SladeKraven Re: Need some help - 12/01/05 12:54 PM
on 1:TEXT:$(* $+ $me $+ *):#: {
Posted By: DiMTRX Re: Need some help - 12/01/05 12:55 PM
Edit:


The highlight part works fine, but the char isnt speaking to me frown
Posted By: SladeKraven Re: Need some help - 12/01/05 01:01 PM
Code:
on 1:TEXT:$(* $+ $me $+ *):*: {
  if ($window($active) == $target) {
    return
  }
  if (!$appactive) {
    if ($agent(Mike)) { 
      gtalk Nick Call: $nick in $chan said: $1- 
    }
    else {
      gload Mike Mike.acs
      gtalk Nick Call: $nick in $chan said: $1-
    }
  }
  else {
    echo 14 -a 4[Nick Call]7 $nick in7 $chan said: $1-
  }
}
Posted By: DiMTRX Re: Need some help - 12/01/05 01:10 PM
Still nothing :'(

btw i changed

Code:
gtalk Nick Call: $nick in $chan said: $1-


to

Code:
gtalk Mike Nick Call: $nick in $chan said: $1-


so thats not the problem aswel frown
Posted By: DiMTRX Re: Need some help - 12/01/05 02:37 PM
Got it working smile
Posted By: SladeKraven Re: Need some help - 12/01/05 02:46 PM
Good. My apologies. smile
Posted By: LethPhaos Re: Need some help - 12/01/05 06:08 PM
------------------------------------------------
;on *:text:$(* $+ $highlight($1-) $+ *):*:{
; if ($chan !== $active) {
; echo -a Highlight: $nick in $chan said: $1-
; }
; if (!$appactive) {
; gload -h voice rover.acs
; gtalk voice Highlight: $nick in $chan said: $1-
; gunload voice
; }
;}
------------------------------------------------
This is my code (don't mind it is commentedt out, that's because I've a problem with the $highlight.

The problem is: it doesn't just spam tha lines I'm highlighted in, it spams everything said in a channel to the active channel :s
Help! laugh
Posted By: Iori Re: Need some help - 12/01/05 08:41 PM
Try this
Code:
on *:text:*:#:{
  if $highlight($1-) {
    if $chan != $active || $cid != $activecid { echo -bflirt Highlight: $nick in $chan said: $1- }
    if !$appactive {
      .gload -h voice rover.acs
      .gtalk voice Highlight: $nick in $chan said: $1-
    }
  }
}
on *:agent:if $agentname == voice { .gunload voice }
Posted By: LethPhaos Re: Need some help - 12/01/05 08:53 PM
Nice thanx! the echoing part works perfect now, except for the color, but I'll play a while with that.

I still get an error with the reading stuff:
-
* /gload: error loading 'voice' (rover.acs) (line 15, LethPhaos Script - Current Projects.mrc)
-
The file rover.acs is in the mirc folder.
Posted By: Iori Re: Need some help - 12/01/05 08:57 PM
AFAIK rover.acs must be in <Windir>\msagent\chars


Oh and the color
Change it to this
  • echo -bflirt Highlight: $nick in $chan said: $1-
and the color should be the color from highlight settings in options. smile
Posted By: LethPhaos Re: Need some help - 12/01/05 09:04 PM
thanx
the .acs file is a copy of the file in the windir directory, it should still be there :s
any other possible solutions?
Posted By: Iori Re: Need some help - 12/01/05 09:07 PM
Damaged or corrupt agent perhaps, Try gload -h voice default
Posted By: LethPhaos Re: Need some help - 12/01/05 09:13 PM
indeed, that helped. The agent now pops up, gives the text in a text balloon and disappears.
Will it pop up over a running game for example without disturbing it?
Can you make the agent litteraly really READ it?
Posted By: Iori Re: Need some help - 12/01/05 09:20 PM
>> Will it pop up over a running game for example without disturbing it?
I can't tell you, I have no games installed on this machine. Try it and see grin

>>Can you make the agent litteraly really READ it?
Read what?
Posted By: LethPhaos Re: Need some help - 12/01/05 09:26 PM
read loud, like speaking, is that possible?
Posted By: Iori Re: Need some help - 12/01/05 09:51 PM
Yes, that's what it does, but if you're using WinXP you have to install SAPI 4 engine, see the note in Step 3 of The use of Agents with mIRC
Posted By: LethPhaos Re: Need some help - 12/01/05 09:53 PM
Ok thanx for all the help! I'm going to bed now, school tomorrow wink
Posted By: Iori Re: Need some help - 12/01/05 09:55 PM
NPs smile
Posted By: Darkmnm Re: Need some help - 13/01/05 01:13 AM
I'm trying to inorperate your cade here into what I am currently using but I also use a sound that i want to play first then the agent load and say what was said and then unload. I basically have it working but the sound plays as the agent is speaking. I can make it so the agent speaks first and then the sound plays but i think it would be better if the sound plays first then the agent speak. From the code below is there a way this can be done. I know it can be using a timer but if I can avoid using one it would be better. thanks in advance for any help on this.

Code:
  
on ^:text:*:#:{
  if ($R.Set(Nicky,Your.Nick.Win) == On) &amp;&amp; ($me isin $1-) {
    /window -n @Nick.Messages
  /echo @Nick.Messages  $ts $c(3) »»» $c(1) $+ Your nick was mentioned by $c(2) $+ $nick $c(1) $+ in $c(2) $+ $chan $+ . $c(1) $+ With the msg of : $c(2) $+  $1- | .splay $mircdirsounds/notice.wav }
  if !$appactive {
    .gload -h voice Merlin.acs
    .gtalk voice $nick said: $1-
  }
}
on *:agent:if $agentname == voice { .gunload voice }

on ^*:text:*:#:{
  if ($R.Set(Nicky,Your.Nick.Win) == On) &amp;&amp; (%alt_nick isin $1-) {
    /window -n @Nick.Messages
  /echo @Nick.Messages  $ts $c(3) »»» $c(1) $+ Your nick was mentioned by $c(2) $+ $nick $c(1) $+ in $c(2) $+ $chan $+ . $c(1) $+ With the msg of : $c(2) $+  $1- | .splay $mircdirsounds/notice.wav }
  if !$appactive {
    .gload -h voice Merlin.acs
    .gtalk voice $nick said: $1-
  }
}
on *:agent:if $agentname == voice { .gunload voice }
Posted By: LethPhaos Re: Need some help - 13/01/05 09:14 PM
Ok i found another problem, when someone says a number without something else the agents pops up and tells me I'm highlighted.
What could be the problem?

Code atm is:
-----------------------------------------------------------------
on *:text:*:#:{
if $highlight($1-) {
if ( $chan !== $active || $cid != $activecid ) { echo -alt < $+ HIGHLIGHT: $nick @ $chan $+ > $1- }
if !$appactive {
talk You were highlighted by $nick
}
}
}

alias talk {
.gload -h talk default
.gtalk talk $$1-
}
on *:agent:if ( $agentname == talk ) { .gunload talk }
-----------------------------------------------------------------
Posted By: Iori Re: Need some help - 13/01/05 11:44 PM
OK That' would happen for any number<= your total highlight ebtries (in options) because you can also use$highlight(N).

Easy fix is to add something to the front of the $1-, such as $nick.
Code:
on *:text:*:#:{
  if $highlight([color:red]$nick[/color] $1-) {
    if ( $chan !== $active || $cid != $activecid ) { echo -alt &lt; $+ HIGHLIGHT: $nick @ $chan $+ &gt; $1- }
    if !$appactive { talk You were highlighted by $nick }
  }
}
Posted By: Iori Re: Need some help - 13/01/05 11:50 PM
Hm I take it it's a longish sound (ogg or mp3 or such). Possibly use on mp3end / waveend / midiend (depending on the sound file type), check if $filename is the one used here and if so then do the agent stuff from that event.
Posted By: LethPhaos Re: Need some help - 14/01/05 03:36 PM
Thanx Iori !
Posted By: paradoxial Re: Need some help - 15/01/05 06:18 AM
was wondering if someone knew were i could find a small http downloader for my *.mrc files download to a dir then reload the files

thanks
© mIRC Discussion Forums