mIRC Home    About    Download    Register    News    Help

Print Thread
#52621 05/10/03 09:42 PM
Joined: Jan 2003
Posts: 39
Q
quiglag Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jan 2003
Posts: 39
I want an on text that If there is only one word said it will msg one thing but if 2 words are said it will msg another thing. The first word being the same word on both.

ex.
<BOB> One
<Bill> xghxghx

<BOB> One Two
<Bill> xghxghx Two

<BOB> Five Three
<Bill> ghjkghjk Three

I hope you understand what I am trying say

Thanks for the help

#52622 05/10/03 09:49 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
If you're saying what I think you're saying:

ON *:TEXT:One:#{
msg $chan xghxghx
}

ON *:TEXT:One *:#:{
msg $chan xghxghx $2-
}

etc

#52623 05/10/03 10:03 PM
Joined: Jan 2003
Posts: 39
Q
quiglag Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jan 2003
Posts: 39
This is an ip script. What i want is:

!IP1 will return 123.456.777
!IP1 PASS will return 123.456.777?password=PASS

If no pass is said it will msg the first line but if a word is said after !IP* it will msg the second line

Code:
 
On *:text:!ip*:#:{
  If /* iswm $1 || $ctrlenter { return }
  var %i = 1, %total = $0, %word, %string
  while %i &lt;= %total {
    %word = $ [ $+ [ %i ] ]
    if $readini(acro.mrc,gameip,%word) {
      %string = %string $ifmatch
    }
    else return
    %i = %i + 1
  }
  If ($2 == $null) msg $chan %string   [color:red]&lt;--- this line works [/color]
  Else msg $chan %string $+ ?password= $+ $2   [color:red]&lt;--- this one doesnt [/color]
}
 

#52624 06/10/03 01:40 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Why are you using "If /* iswm $1 || $ctrlenter { return }"? This is for ON INPUT code. Unless you use this for any specific feature, you don't need it there.
BTW, you wouldn't need to use "%i = %i + 1"; use "inc %i" instead.

But the real question is: If you need only 2 known parameters (!ip and $2), why the loop and the INI checking? Please explain this code a little further, with more varied examples. I was trying to help (I can see an error related to the return command) but ended giving up, since I don't know exactly how to fix it without knowing what it should do.


* cold edits his posts 24/7
#52625 08/10/03 04:23 AM
Joined: Jan 2003
Posts: 39
Q
quiglag Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jan 2003
Posts: 39
I am a n00b scripter so I used a modded acros script, that why the extra stuff is there. blush

#52626 08/10/03 04:31 AM
Joined: Jan 2003
Posts: 39
Q
quiglag Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jan 2003
Posts: 39
What i want is , if someone types !ip1 it will msg the IP but if someone types !ip1 with a word after it (!ip1 pass) it will msg the IP and the word (pass)

#52627 08/10/03 05:23 AM
Joined: Jan 2003
Posts: 39
Q
quiglag Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jan 2003
Posts: 39
I got this to do what i need. Thanks for all the help

Code:
 On *:text:!iv*:#:{
  var %i = 1, %total = $0, %word, %string
  while %i &lt;= %total {
    %word = $ [ $+ [ %i ] ]
    if $readini(acro.mrc,gameip,%word) {
      %string = %string $ifmatch
    }
    inc %i
  }
  If ($2 == $null) { msg $chan %string ) }
  Else { msg $chan %string $+ ?password= $+ $2 ) }
}
 


Link Copied to Clipboard