Bot's FileList
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Bot's FileList

Started by Myth, 15 January, 2004, 15:07:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Myth

i'm trying to make a script that would pm a user if he tries to get the filelist from a bot...  :)
i was pretty sure it was easy.. but somethig went wrong... it just won't work..
here's the script (part of it...)

function DataArrival(user,data)

   if strfind(data, "$RevConnectToMe")) then
      user:SendPM(bot, "I'm just a bot...")
   end

end

can anyone tell me what i'm doing wrong?
 i've did some tests.. replacing $RevConnectToMe with $Search, for example, and it worked... with anythig else worked.. but not with $RevConnectToMe... ?(  X(
Our lives begin to end the day we become silent about things that matter

raz

r u sure u don't need the bot name.

Myth

?(
of course i need the name of the bot.. but i'm reading it from an ini file at the begining of the script... that's not the prob,  the $RevConn.... line seems to be
Our lives begin to end the day we become silent about things that matter

raz

can u post all of the script on here.  den it will be easier 2 help u.lol  :D

Myth

#4
ok.. i've finished it... and i've found what was wrong..
i was trying to make it a part of a bigger script... and the mistake was somewhere else... in the big script..
here's the lua part

function Main()

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

end

function NewUserConnected(curUser) 

   SendToAll("$MyINFO $ALL "..bot.." "..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  == "[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


and 1.ini file:


bot = "[bot]Share"
botmail = "NoShare@Dont.Bother"
botshare = "1099511627776"
botinfo = "<++ V:0.01,M:A,H:1/1/1,S:0>"
botdesc = "just a fuckin bot"
botconn = "UnknowN ExtraTerrestriaL SatelitE"


anyway thx for trying to help me
Our lives begin to end the day we become silent about things that matter

Myth

oops... it seems that something was wrong there...
here's the correct code:

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"
Our lives begin to end the day we become silent about things that matter

SMF spam blocked by CleanTalk