PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: Myth on 17 January, 2004, 14:39:14

Title: FakerBot
Post by: Myth on 17 January, 2004, 14:39:14
A fake share bot.. not what U think :)

--FakerBot by Myth v1.0
--it works for both passive and active users
--thx to Optimus for his bot's MyINFO idea
--thx to Ra3or for his idea with the message form the bot
--ppl form the LUA Language Board for the help




function Main()

   frmHub:EnableFullData(1)
   assert(dofile("settings.ini"))
   frmHub:RegBot(bot)
end

function NewUserConnected(curUser)
   SendToAll("$MyINFO $ALL "..bot.." "..botdesc.." "..botinfo.."$ $"..botconn.."$"..botmail.."$"..botshare.."$")
--$MyINFO $ALL [OP]Myth --==@==--<++ V:0.306,M:A,H:1/0/3,S:2>$ $LAN(T1)$--==@==--$19641023012$|
end


function DataArrival(user,data)
   if (strsub(data, 1, 15) == "$RevConnectToMe") then
      local _,_,botname = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|")
      if (botname  == "[bot]Console#") then
         user:SendPM(botname, "Man... R u an IDIOT or what?!?! Can't U see I'm just a damn bot?")
      end
   elseif (strsub(data, 1, 12) == "$ConnectToMe") then
   local _,_,botname = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")
      if (botname  == "[bot]Console#") then
         user:SendPM(botname, "Man... R u an IDIOT or what?!?! Can't U see I'm just a damn bot?")
      end
   end
end



Settings.ini file:


bot = "[bot]Share"

botmail = "NoShare@Dont.Bother"
botshare = "1099511627776" --the share in bytes
botinfo = "<++ V:1.0,M:A,H:1/1/1,S:0>"
botdesc = "just a fuckin bot"
botconn = "UnknowN ExtraTerrestriaL SatelitE"


Title:
Post by: tezlo on 17 January, 2004, 16:59:05
will only work if you name the bot "[bot]Console#"
also theres no need to send myinfo to all users over and over
Title:
Post by: Myth on 17 January, 2004, 17:31:40
yap.. u're right..
and i've corected the name of the bot thing... sry for that... i've copied the code from my test script.. and that was the name of the bot... (actually was the Console script by [NL]Pur, witch i've modified a little ;) )

here's the correct version.. with the "botinfostring" sent at OpConnected
i hope this works :)


--FakerBot by Myth v1.1
--thx to Optimus for his bot's MyINFO idea
--ppl form the LUA Language Board for the help




function Main()

   frmHub:EnableFullData(1)
   assert(dofile("settings.ini"))
   frmHub:RegBot(name)
end


function OpConnected(user)

   SendToAll("$MyINFO $ALL "..name.." "..botdesc.." "..botinfo.."$ $"..botconn.."$"..botmail.."$"..botshare.."$")

end


function DataArrival(user,data)

   if (strsub(data, 1, 15) == "$RevConnectToMe") then
      local _,_,botname = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|")
      if (botname  == name) then
         user:SendPM(botname, "Man... R u an IDIOT or what?!?! Can't U see I'm just a damn bot?")
      end
   elseif (strsub(data, 1, 12) == "$ConnectToMe") then
   local _,_,botname = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")
      if (botname  == name) then
         user:SendPM(botname, "Man... R u an IDIOT or what?!?! Can't U see I'm just a damn bot?")
      end
   end

end


Settings.ini file:


name = "[bot]Share"

botmail = "NoShare@Dont.Bother"
botshare = "1099511627776" --the share in bytes
botinfo = "<++ V:1.0,M:A,H:1/1/1,S:0>"
botdesc = "just a fuckin bot"
botconn = "UnknowN ExtraTerrestriaL SatelitE"

Title:
Post by: pHaTTy on 17 January, 2004, 22:23:27
QuoteOriginally posted by Myth
yap.. u're right..
and i've corected the name of the bot thing... sry for that... i've copied the code from my test script.. and that was the name of the bot... (actually was the Console script by [NL]Pur, witch i've modified a little ;) )

here's the correct version.. with the "botinfostring" sent at OpConnected
i hope this works :)


--FakerBot by Myth v1.1
--thx to Optimus for his bot's MyINFO idea
--ppl form the LUA Language Board for the help




function Main()

   frmHub:EnableFullData(1)
   assert(dofile("settings.ini"))
   frmHub:RegBot(name)
end


function OpConnected(user)

   SendToAll("$MyINFO $ALL "..name.." "..botdesc.." "..botinfo.."$ $"..botconn.."$"..botmail.."$"..botshare.."$")

end


function DataArrival(user,data)

   if (strsub(data, 1, 15) == "$RevConnectToMe") then
      local _,_,botname = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|")
      if (botname  == name) then
         user:SendPM(botname, "Man... R u an IDIOT or what?!?! Can't U see I'm just a damn bot?")
      end
   elseif (strsub(data, 1, 12) == "$ConnectToMe") then
   local _,_,botname = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")
      if (botname  == name) then
         user:SendPM(botname, "Man... R u an IDIOT or what?!?! Can't U see I'm just a damn bot?")
      end
   end

end


Settings.ini file:


name = "[bot]Share"

botmail = "NoShare@Dont.Bother"
botshare = "1099511627776" --the share in bytes
botinfo = "<++ V:1.0,M:A,H:1/1/1,S:0>"
botdesc = "just a fuckin bot"
botconn = "UnknowN ExtraTerrestriaL SatelitE"


what is botname now?
Title:
Post by: Snoris on 17 January, 2004, 23:08:29
QuoteOriginally posted by (uk-kingdom)pH?tt??
QuoteOriginally posted by Myth
yap.. u're right..
and i've corected the name of the bot thing... sry for that... i've copied the code from my test script.. and that was the name of the bot... (actually was the Console script by [NL]Pur, witch i've modified a little ;) )

here's the correct version.. with the "botinfostring" sent at OpConnected
i hope this works :)


--FakerBot by Myth v1.1
--thx to Optimus for his bot's MyINFO idea
--ppl form the LUA Language Board for the help




function Main()

   frmHub:EnableFullData(1)
   assert(dofile("settings.ini"))
   frmHub:RegBot(name)
end


function OpConnected(user)

   SendToAll("$MyINFO $ALL "..name.." "..botdesc.." "..botinfo.."$ $"..botconn.."$"..botmail.."$"..botshare.."$")

end


function DataArrival(user,data)

   if (strsub(data, 1, 15) == "$RevConnectToMe") then
      local _,_,botname = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|")
      if (botname  == name) then
         user:SendPM(botname, "Man... R u an IDIOT or what?!?! Can't U see I'm just a damn bot?")
      end
   elseif (strsub(data, 1, 12) == "$ConnectToMe") then
   local _,_,botname = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")
      if (botname  == name) then
         user:SendPM(botname, "Man... R u an IDIOT or what?!?! Can't U see I'm just a damn bot?")
      end
   end

end


Settings.ini file:


name = "[bot]Share"

botmail = "NoShare@Dont.Bother"
botshare = "1099511627776" --the share in bytes
botinfo = "<++ V:1.0,M:A,H:1/1/1,S:0>"
botdesc = "just a fuckin bot"
botconn = "UnknowN ExtraTerrestriaL SatelitE"


what is botname now?

Well...I wonder that to phatty =]