Author Topic: OnName script  (Read 6864 times)

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
OnName script
« on: July 23, 2008, 11:28:28 PM »
A script so that everytime someone says my name = SniperPro

It says My name has been said X times

X standing for how many times my name has been said since I installed the script.

But says it in a /notice

And also make it where I can check how many times my name has been said.

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: OnName script
« Reply #1 on: July 24, 2008, 01:12:20 AM »
Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If inStr(LCase(Message),LCase(GetIdentifier("$me"))) then
  Count = GetIniFile("count.ini","count","nick_count",0)
  Count = Count + 1
  WriteIniFile "count.ini","count","nick_count",Count
  SendCommand "/notice " & Nickname & " My name has been said " & Count & " times",ServerNumber
End If
End Sub

Sub CheckCount()
Count = GetIniFile("count.ini","count","nick_count",0)
SendCommand "/echo -a Number of times my nickname has been said: " & Count
End Sub

To display the number of times your nick has been said type /! CheckCount
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: OnName script
« Reply #2 on: July 24, 2008, 02:36:32 PM »
I would just make 1 change, just in case you are on multiple servers.

Code: [Select]
If inStr(LCase(Message),LCase(GetIdentifier("$me",ServerNumber))) then

Also know, that with the Text Highlighter, you can run commands as well.
The IceChat God

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: OnName script
« Reply #3 on: July 24, 2008, 02:49:30 PM »
Alright thanx allot guys :D

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Re: OnName script
« Reply #4 on: July 25, 2008, 02:25:21 PM »
I like using this one, it tells you when someone says your name, and which channel/network. if they say your name on in the current channel, it won't show the message, because you can already see it.

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
message = lcase(message)
chan = getidentifier("$currentwindow")
net = getidentifier("$network",servernumber)
 if instr(message,lcase(mynickname(servernumber))) then
  if chan = channel then exit sub
  sendcommand "/scid " & network & " /echo " & nickname & " said your name in " & channel & " on the " & net & " network.",servernumber
 end if
End Sub

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: OnName script
« Reply #5 on: July 25, 2008, 03:59:49 PM »
:o

I really like that one, can you make is so that if a bot, like this:

[18:50] * ChanServ sets mode +o SniperPro for #kamuixdm

Says my name it does not send me a message?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: OnName script
« Reply #6 on: July 25, 2008, 04:07:49 PM »
That is not a channel message, that is a mode.
So you will need to used the ONMODE event function.
The IceChat God

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: OnName script
« Reply #7 on: July 25, 2008, 05:13:59 PM »
Yes, but that and I want it so that if I am in-game playing and my name is mentioned in that server, and I am also on the IRC channel, I don't want to be notifyed.

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Re: OnName script
« Reply #8 on: July 27, 2008, 12:51:07 AM »
I think theres a if iscurrent or isforeground or something that checks if Icechat is the current application, that might help.

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: OnName script
« Reply #9 on: July 27, 2008, 03:01:49 AM »
Can someone do this for me >.>

I'm stupid with scripts  :-(

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: OnName script
« Reply #10 on: July 27, 2008, 06:52:17 AM »
SniperPro, you might wanna take a look at some vbscript tutorial and the scripting section of this site, that should help you figure out some stuff
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

SniperPro

  • Newbie
  • *
  • Posts: 44
  • Have no fear! SniperPro is here! ;D
    • Myspace
Re: OnName script
« Reply #11 on: July 30, 2008, 12:47:39 AM »
[3:45:15am] [*Alert] agentwite said your highlight in #Hangout [<censored> goes where tha action is].

This is a mIRC script, I changed the name of the person who showed it to me and put censored, Is there a way that you guys can make this script so that when someone says my name it shows the sentence or whatever they said using my name in also?

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: OnName script
« Reply #12 on: July 30, 2008, 01:27:30 AM »
use the ONTEXT sub to catch the message, then use InStr to check for your nickname, then use 'SendCommand "/echo..."' to view the message in your current window
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein