topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 19, 2024, 7:19 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: on *:text:* problems  (Read 11516 times)

robbertA

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
on *:text:* problems
« on: August 17, 2009, 04:58 PM »
So, first of all, I did read this one:
https://www.donation...intpage;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.

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, 05:00 PM by robbertA »

robbertA

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: on *:text:* problems
« Reply #1 on: August 19, 2009, 05:09 PM »
Anyone ,,,... ?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: on *:text:* problems
« Reply #2 on: August 19, 2009, 05: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
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: on *:text:* problems
« Reply #3 on: August 20, 2009, 04:25 PM »
Okidoki, thanks budd

robbertA

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

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,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: on *:text:* problems
« Reply #5 on: September 02, 2009, 12:41 PM »
your tests
  if ($chan == #.pre) {
    if ($nick == pRemature) {

have to change.

youll see in the sample function it says:
  ; $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
  if ($2== #.pre) {
    if ($3== pRemature) {

robbertA

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: on *:text:* problems
« Reply #6 on: September 02, 2009, 03: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,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: on *:text:* problems
« Reply #7 on: September 02, 2009, 03: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.