mIRC Home    About    Download    Register    News    Help

Print Thread
#254147 24/07/15 11:32 AM
Joined: Jul 2015
Posts: 42
J
Joveice Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jul 2015
Posts: 42
this script does not check if %Bot = On / Off and when i make it type out %bot its null in the message
It does work on setting on / off but when its on its gonna say bot is already on, but it doesent, it just writes on in the file again
my nick is Admin and that works the bot in the database is Bot=on
so %Bot is null here whats the problem ?

Code:
 on *:TEXT:!bot *:#: {
  if (VoltTechBot !isop #) {
    msg $chan I don't have mod or im still booting up.
    /halt
  }
  if ($chan == #volttechbot) { /halt }
  var %chani = C:\Users\server\Documents\mIRCsave\ $+ $chan $+ \register.txt | var %pointy = C:\Users\server\Documents\mIRCsave\ $+ $chan $+ \Points.ini | var %topic = $+(#,.,$nick) | var %Group = $readini(%pointy,%topic,Group) | var %BotStatus = C:\Users\server\Documents\mIRCsave\ $+ $chan $+ \database.ini | var %topicb = Bot.Status | var %Bot = $read(%BotStatus,%topicb,Bot)

  if (%Group == Admin) {
    if ($2 == Off) {
      if (%bot == off) { 
        msg $chan Bot is already Off 
        /halt
      }
      /msg $chan Bot is now Off
      var %topicb = Bot.Status
      writeini -n %botstatus %topicb Bot off
      /halt
    }
    if ($2 == On) { 
      if (%bot == on) { 
        msg $chan Bot is already On 
        /halt
      }
      /msg $chan Bot is now On
      var %topicb = Bot.Status
      writeini -n %botstatus %topicb Bot on
      /halt
    }
  }
}

Last edited by Joveice; 24/07/15 11:41 AM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
You're using $read instead of $readini to set %bot

Joined: Jul 2015
Posts: 42
J
Joveice Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jul 2015
Posts: 42
thank you


Link Copied to Clipboard