mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
Hey, im tryin to make a script, but its a bit outta my league, basically i know the theory on how it would need to work, jus writin the script for it is wuts the prob.

1. on text !collect collects From #channel and writes all voiced nicks in ToCheck.txt

2. on text '!begin n' does a /ctcp $read(tocheck.txt) !list . (However if $nick isin CheckedServers.txt another nick is chosen). N Being a Number, so if it was !begin 5 itd do the process 5 times etc

3. on Notice if /ctcp isin $1- it does /ctcp bla bla bla until a >> or ] so say it was

wuteva blah yeh Trigger: <</ctcp zzzzz fjhg dsjg shg>>
it would preform /ctcp zzzzz fjhg dsjg shg

4. On DCC Chat Session $nick if it contains anything other then *.XXX . Write (WrongFiles.txt) $nick and filename.YYY

then exit

Note for 4: If there are folders inside it does CD FOLDERNAME - checks the data, CD .. , then CD FOLDERNAME2 etc.

5. add $nick to CheckedServers.txt. (dunno if this is possible, but after 1 week, $nick is removed from CheckedServers.txt)

6. Proccess Begins Again N Number of times

Joined: Jun 2005
Posts: 11
H
Pikka bird
Offline
Pikka bird
H
Joined: Jun 2005
Posts: 11
Why not try writing something, and show us, and we'll guide you, instead of making us to write everything for you? smile


- hantu
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
like i said - im only new to mirc scripting and can just do the basic scripts - with a script like this i really have no hope, wouldnt even know where to begin

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Quote:
1. on text !collect collects From #channel and writes all voiced nicks in ToCheck.txt


Well here is a start, im dont particularly think your use of txt files is the most appropriate way to do what you want, but here is the first part anyway.

Code:
on *:text:!collect:#: {
  var %x = 1, %y = $nick(#,0,v)
  while (%x &lt;= %y) {
    write tocheck.txt $nick(#,%x,v)
    inc %x
  }
}


Incase some are not sure what onesikgypo is after, its basically a sever checker to make sure file servers in some file serving chan are working and do not contain bad files (such as xxx). Personally i think would probably be better just to issue a channel !list in order to get the full list of servers and there ads/triggers, and go through them from there.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Type /help scripts and start reading smile Try some of the examples in the help file, understand why and how they work, play around with them, test some changes and expansions, go to a scripting site like www.mirc.net or www.mircscipts.org, look for basic tutorials and read and try those, also check out snippets on those sites and try to understand how they work. This can come down to using /help to lookup each and every /command or $identifier...

Once you feel comfortable with basic scripting, you can start writing your own, and reading more advanced tutorials. Don't be afraid to test stuff out, use a separate mIRC if you need to and press ctrl-break if your mIRC ever hangs when one of your scripts has an error.

ps: yes, I know that you won't be able to do all above tonight, it takes time...

Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
alright this is the far im gonna get, can someone else help us with the dcc chat and also check over myscript as well
Code:
 
#ServerChecker off 
on *:text:!collect:#:{ 
  var %a = $nick($chan,v,0) 
  while %a { 
    .write -s $+ $nick($chan,v,%a) ToCheck.txt $nick($chan,v,%a) 
    inc %a 
  } 
} 
on *:text:!begin &amp;:*:{ 
  if $2 !isnum { .msg $nick Format: !begin &lt;number&gt; } 
  else { 
    set %a $2 
    while %a { 
      set %b $lines(ToCheck.txt) 
      while %b { 
        check.voice %a %b 
        inc %b 
      } 
      inc %a 
    } 
  } 
} 
alias check.voice { 
  .enable #ServerChecker.1 
  ctcp $read(ToCheck.txt,%b) !list 
} 
#ServerChecker end 
#ServerChecker.1 off 
on *:text:*:?:{ 
  var %text = $pos($1-,/,1) 
  while %text &lt;= $len($1-) &amp;&amp; %text isnum { 
    if $mid($1-,%text,1) !isalnum { 
      set %text $mid($1-,$pos($1-,/,1),%text) 
    } 
    if %text isnum { 
      inc %text 
    } 
  } 
  /ctcp $(%text,2) 
} 
on *:notice:*:?:{ 
  var %text = 1 
  while %text &lt;= $len($1-) &amp;&amp; %text isnum { 
    if $mid($1-,%text,1) !isalnum { 
      set %text $mid($1-,1,%text) 
    } 
    if %text isnum { 
      inc %text 
    } 
  } 
} 
#ServerChecker.1 end 

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
From the look of your code it doesn't seem like you have grasped any concept of scripting at all, your if statements and while loops are incorrect for the most part, both of these functions are going to be very important in the part of the script that will actually spider/check the server. You even used $nick($chan,v,0) when i had already shown you $nick($chan,0,v).

I would strongly suggest reading through /help, try out the examples and play around until you understand how they work. Then maybe you are ready to try a few more simple scripts/snippets before attempting such a task.

As an alternative, these is infact a bot written for the purpose of spidering file servers, which has a dcc chat interface for you to get info and perform searches. Perhaps if you are able to find it, i misplaced my copy during a format some time ago, it would save you a lot of time. It was simply called File Scanner aka Synopse last i heard, written by a NonReal on DALnet originally, i forget who took over and rewrote the new version.

Code:
 
#ServerChecker off 
[color:red]; Your syntax for $nick() was incorrect, and your while loop had no
; comparison (%a was always going to exist)[/color]
on *:text:!collect:#: {
  var %x = 1, %y = $nick($chan,0,v)
  while (%x &lt;= %y) {
    write -s $+ $nick($chan,%x,v) tocheck.txt $nick($chan,%x,v)
    inc %x
  }
}
[color:red]; no need for the else, just use a return in the initial if, again your while
; syntax is broken.  used var instead of set, no need for a global variable.
; No need to send line number to check.voice, just send the nickname as
; read from the file.[/color]
on *:text:!begin &amp;:*:{ 
  if ($2 !isnum) { .msg $nick Format: !begin &lt;number&gt; | return } 
  var %a = $iif($2 &gt; $lines(tocheck.txt),$lines(tocheck.txt), $2)
  while (%a &gt; 0) {
    check.voice $read(tocheck.txt)
    dec %a
  }
} 
[color:red]; this is about where your code go off on its own, not sure why your
; enabling the second group here at all, since its never disabled... rather
; than use a group that will not be enabled/disabled at the correct times
; store the nicks in a global variable for later checking[/color]
alias check.voice { 
  if (!$findtok(%check_voice_nicks,$1,1,32)) {  set %check_voice_nicks %check_voice_nicks $1 }
  ctcp $1 !list 
} 
#ServerChecker end 
[color:red]; i've no idear the point of this, looks like you were trying to get the
; trigger from the ad, but iirc server ads are sent via notice not private
; message when requested with !list ?[/color]
on *:text:*:?:{ 
  var %text = $pos($1-,/,1) 
  while %text &lt;= $len($1-) &amp;&amp; %text isnum { 
    if $mid($1-,%text,1) !isalnum { 
      set %text $mid($1-,$pos($1-,/,1),%text) 
    } 
    if %text isnum { 
      inc %text 
    } 
  } 
  /ctcp $(%text,2) 
} 
[color:red]; this makes no sense at all to me, again your while loop is completely
; broken, if %text gets set to a non alnum in the first if, %text will never
; increase and you will enter an endless loop.[/color]
on *:notice:*:?:{ 
  var %text = 1 
  while %text &lt;= $len($1-) &amp;&amp; %text isnum { 
    if $mid($1-,%text,1) !isalnum { 
      set %text $mid($1-,1,%text) 
    } 
    if %text isnum { 
      inc %text 
    } 
  } 
} 
[color:red]; i think i would simply abandon these last two events[/color]


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
well im having trouble finding the script ur talking of, and also i do realise that my scripting capabilities are no where good enough, and im trying to get better but like you said that is going to take a while - but i need this script now :S so yeh, thats the best i could do, and lol as you see theres lots of probs with it which is why i said at first this script was way outta my league

Joined: Oct 2005
Posts: 122
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
*bump* anybody able 2 help us out wit the rest of the script?


Link Copied to Clipboard