mIRC Home    About    Download    Register    News    Help

Print Thread
#159127 14/09/06 11:03 AM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
Code:
  if (*hi454* iswm %Read) {
    sockread %Read
    echo -a %Read
  }

  if (*45435* iswm %Read) {
    sockread %Read
    sockread %Read
    echo -a %Read
  }

  if (*gfdgfdg* iswm %Read) {
    sockread %Read
    sockread %Read
    echo -a %Read
  }

  if (*dgdsg* iswm %Read) {
    sockread %Read
    echo -a %Read
  }

  if (*543gfdhgd* iswm %Read) {
    sockread %Read
    echo -a %Read
  }


any way i can make that smaller? i dont think its very good coding at all :S

#159128 14/09/06 12:46 PM
Joined: Sep 2006
Posts: 59
R
Babel fish
Offline
Babel fish
R
Joined: Sep 2006
Posts: 59
why is there double sockreads?

#159129 14/09/06 12:57 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
  var %R = %Read
  sockread %Read
  if (*hi454* iswm %R) || (*dgdsg* iswm %R) || (*543gfdhgd* iswm %R) { echo -a %Read }
  if (*45435* iswm %R) || (*gfdgfdg* iswm %R) {
    sockread %Read
    echo -a %Read
  }

#159130 14/09/06 01:01 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
double sockreads because i need to get the 2nd line after the word i find..

hmm. thanks hixxy ill give that a try

Last edited by pouncer; 14/09/06 01:02 PM.
#159131 14/09/06 01:28 PM
Joined: Sep 2006
Posts: 59
R
Babel fish
Offline
Babel fish
R
Joined: Sep 2006
Posts: 59
Why not use a tokenize?

#159132 14/09/06 01:52 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Tokenize wouldn't work in this case, since the information is on a different line on the webpage. Tokenize would only be able to work with the information read into the variable, which ends with the cr/lf command on the website, which in turn, causes the second piece of information they want to be on the line below the one they are reading.

#159133 16/09/06 04:49 AM
Joined: Sep 2006
Posts: 1
S
Mostly harmless
Offline
Mostly harmless
S
Joined: Sep 2006
Posts: 1
Why not something like:

if ((*hi454* || *45435* || *gfdgfdg* || *dgdsg* || *543gfdhgd*) iswm %Read) {
sockread %Read
echo -a %Read
}


Link Copied to Clipboard