DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: on *:text:* problems  (Read 15,541 times)

robbertA

  • Participant
  • Joined in 2009
  • *
  • Posts: 5
on *:text:* problems
« on: August 17, 2009, 09:58 PM »
So, first of all, I did read this one:
Quote
http://www.donationcoder.com/forum/index.php?action=printpage;topic=8133.0

But I don't get it how I should fix my script, it gets text from a bot,
but then it splits it up like in normal mirc into $1 $2 $3, etc. One big
problem, with mircryption they all become blank, so question to the
wise guys here, how can I fix the thing I am using so $3 $5 and $8
do give the correct text that is on the 3th 5th and 8th place in the
line of text the bot says.

Quote
on *:TEXT:*:#:{
 if ($nick == TopBot) {
   set -e %type $3
   set -e %name $5
   set -e %date $8
   /scon 1 /notice %output.channel DATE:    %date
   /scon 1 /notice %output.channel TYPE:    %type
   /scon 1 /notice %output.channel NAME: %name
   /scon 1 /notice %output.channel ---------------------------
}
}

Hope to get some help, much appreciated!
« Last Edit: August 17, 2009, 10:00 PM by robbertA »

robbertA

  • Participant
  • Joined in 2009
  • *
  • Posts: 5
Re: on *:text:* problems
« Reply #1 on: August 19, 2009, 10:09 PM »
Anyone ,,,... ?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: on *:text:* problems
« Reply #2 on: August 19, 2009, 10:32 PM »
ok so first thing you know from the other post you linked that the on *:TEXT:*:# procedure itself is not going to be called.
and that what you are going to have to do is add something in the MircryptionSignalAll function to respond to the text.

basically $5 in MircryptionSignalAll is the same as $1 in your on text, and $6 is same as $2 and so on. 
($3 is same as $nick)

see the mircryptionsignal all definition for more info.

robbertA

  • Participant
  • Joined in 2009
  • *
  • Posts: 5
Re: on *:text:* problems
« Reply #3 on: August 20, 2009, 09:25 PM »
Okidoki, thanks budd

robbertA

  • Participant
  • Joined in 2009
  • *
  • Posts: 5
Re: on *:text:* problems
« Reply #4 on: September 02, 2009, 10:24 AM »
Ok, well I used it but nothing's happening, and I don't really see anything going wrong

Code
on *:SIGNAL:MircryptionSignalAll: {
  if ($chan == #.pre) {
    if ($nick == pRemature) {
      set -e %test.event $1
      set -e %test.target $2
      set -e %test.speaker $3
      set -e %test.encryptedyesno $4
      set -e %test.decryptedtext $5

      /scon 6 /msg #encryptionpre EVENT: %test.event TARGET: %test.target SPEAKER: %test.speaker ENCRYPTED YES OR NO: %test.encryptedyesno DECRYPTED TEXT: %test.decryptedtext

      unset %test.*
    }
  }
}

I just wanted to use it too see how and if it worked

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: on *:text:* problems
« Reply #5 on: September 02, 2009, 05:41 PM »
your tests
Code
  if ($chan == #.pre) {
    if ($nick == pRemature) {

have to change.

youll see in the sample function it says:
Code
  ; $1 = event type (input,text,query,notice,action,join,topic,part,kick,quit,nick,mode)
  ; $2 = target ($chan)
  ; $3 = speaker ($nick)
  ; $4 = is $true if text was encrypted or $false if plaintext
  ; $5- = decrypted text

so your initial tests should be like
Code
  if ($2== #.pre) {
    if ($3== pRemature) {

robbertA

  • Participant
  • Joined in 2009
  • *
  • Posts: 5
Re: on *:text:* problems
« Reply #6 on: September 02, 2009, 08:01 PM »
Ah yes you're obviously right heh forgot that part, works like a charm now, thanks a million !

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: on *:text:* problems
« Reply #7 on: September 02, 2009, 08:03 PM »
great  :up:

you might also want to put a check against the $1 event type, so that you are only triggering on "text" events.

Original address: https://www.donationcoder.com/forum/index.php?topic=19559.0