Id: 2559; Nick: Jqson; Timestamp: 2007-12-10 11:44:25; Pasted as: mIRC
Description: basis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
on $*:text:/^\*/:#:{ 
  var %cmd = $mid($1,2)
  If %cmd == help {
    timer 1 0 notice $nick Help list
    timer 1 1 notice $nick topic cmd: *topic <text> (This will change the topic and save it)
    timer 1 2 notice $nick refresh cmd: *refresh (This will load the topic)
    timer 1 3 notice $nick remove cmd: *remove (This will remove the saved topic)
    timer 1 4 notice $nick setlevel cmd: *setlevel <nick> <level> (This will add a new user)
    timer 1 5 notice $nick level cmd: *levels (This will list the bot levels)
  }
  elseif %cmd == levels {
    timer 1 0 notice $nick Aviable levels
    timer 1 1 notice $nick 0 = 
    timer 1 2 notice $nick 1 =   
    timer 1 3 notice $nick 2 =
    timer 1 4 notice $nick 3 =    
    timer 1 5 notice $nick 4 = 
    timer 1 6 notice $nick 5 = 
  }
  elseif %cmd == autovoice {
    if ($readini(bot.ini, userlist, $address($nick, 1)) == 5) || ($readini(bot.ini, $chan , $address($nick, 1)) >= 4) {
      If ($2 == on) { goto on }
      else { If ($2 == off) { goto off }
        :on
        if ($me !isop $chan) { notice $nick 4 $+ ERROR - I will only function on channels where i am opped | .halt }
        if (% [ $+ autovoice. $+ [ $chan ] ] == on) { msg $chan 4 $+ ERROR - Autovoice for $chan is already on | .halt }
        set % [ $+ autovoice. $+ [ $chan ] ] on
        msg $chan 7 $+ Autovoice for $chan is now on
        goto end 
        :off
        if ($me !isop $chan) { notice $nick 4 $+ ERROR - I will only function on channels where i am opped | .halt }
        if (% [ $+ autovoice. $+ [ $chan ] ] == off) { msg $chan 4 $+ ERROR - Autovoice for $chan is already off | .halt }
        set % [ $+ autovoice. $+ [ $chan ] ] off
        msg $chan 7 $+ Autovoice for $chan is now off
      }
      :end
    }
  }
  elseif %cmd == topic {
    if ($readini(bot.ini, userlist, $address($nick, 1)) == 5) || ($readini(bot.ini, $chan , $address($nick, 1)) >= 4) {
      remove topic $+ $chan $+ .txt
      write topic $+ $chan $+ .txt $2-
      timer 1 0 notice $nick Topic for $chan has been saved.
      timer 1 1 notice $nick Use *refresh to reset the topic.
      timer 1 2 topic $chan $2-
    } 
    else {
      notice $nick Access denied.
    }
  }
  elseif %cmd == refresh { 
    if ($readini(bot.ini, userlist, $address($nick, 1)) != 5) || (!$readini(bot.ini, $chan , $address($nick, 1)) >= 4) {
      notice $nick Access denied.
    }
    else { 
      If ($read(topic $+ $chan $+ .txt $+ ) != $null) { 
        topic $chan Refreshing..
        timer 1 5 topic $chan $read(topic $+ $chan $+ .txt $+ )
      }
      else {
        notice $nick Topic has been removed by $nick $+ .
      } 
    }
  }
  elseif %cmd == remove {
    if ($readini(bot.ini, userlist, $address($nick, 1)) == 5) || ($readini(bot.ini, $chan , $address($nick, 1)) >= 4) {
      remove topic $+ $chan $+ .txt
      notice $nick database: removed $chan $+ 's topic
      topic $chan Topic removed by $nick on $date at $time
    } 
    else {
      notice $nick Access denied.
    }
  }
  elseif %cmd == setlevel {
    if ($readini(bot.ini, userlist, $address($nick, 1)) == 5) || ($readini(bot.ini, $chan , $address($nick, 1)) >= 4) && ($3 < $readini(bot.ini, $chan , $address($nick,1))) && (!$readini(bot.ini, $chan , $address($2,1))) {     
      notice $nick Added $2 to userlist with level: $3
      writeini bot.ini $chan $address($2,1) $3
    }
    elseif (!$readini(bot.ini, $chan , $address($2,1))) {
      notice $nick The user already exists. ( $+ $address($nick,1) $+ ) Please use *access <nick> <level>
    }
    elseif ($3 < $readini(bot.ini, $chan , $address($nick,1))) {
      notice $nick Denied. You can not set another user a higher level than you.
    }
    elseif ($2 !ison $chan) {
      notice $nick info: $2 was not found on $chan
    }
    elseif (!$readini(bot.ini, userlist, $address($nick, 1)) == 5) || (!$readini(bot.ini, $chan , $address($nick), 1)) >= 4) {
      notice $nick Access denied.
    }
  }
}
on *:join:#: {
  if ($me isop $chan) {
    if (% [ $+ autovoice. $+ [ $chan ] ] == on) {
      .mode $chan +v $nick
    }
  }
}
 
Options: New, Download,
, mIRC Parser;
Copyright © 2006 by Zyberdog - Some rights reserved. (Browse/Disclaimer/Stats/About)
Nothing to see here.