help
 

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

help

Started by Themaster, 23 September, 2004, 16:36:10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Themaster

i have a little problem.. when i do !myip like regestered user...then nothing gone happen...

what have i forgot in the script

Thx with all the help i get ;)
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Herodes


Themaster

That i make

assert(dofile("blade/Setup.lua"),"blade/Setup.lua not found")
assert(dofile("blade/Logincheck.lua"),"blade/Logincheck.lua not found")

Version ="Blade? 1.0"
Build ="~~1.3~~"
Creators ="Themaster?"

sUserCount = frmHub:GetUsersCount()
sHubName = frmHub:GetHubName()
sHubDesc = frmHub:GetHubDescr()
sRedirect = frmHub:GetRedirectAddress()
sMaxUsers = frmHub:GetMaxUsers()
sMinShare = frmHub:GetMinShare(3)
sCurrentShare = frmHub:GetCurrentShareAmount()

Guard_File = "blade/PeerGuardian/Guarding.P2P"

function Main()
   frmHub:UnregBot(BotName)
   frmHub:RegBot(BotName)
   frmHub:RegBot(OpChat)
   TimeSpanInMinutes = 60
   SendToAll("    (? ?.??.->  "..Version.." Build"..Build..date(" the %d/%m-%Y at %X ").."  <-.??.???)" )
   BotNameInfo = "$MyINFO $ALL "..BotName.." <++V:1.0 Blade? 1.0,C:Themaster? $ $LAN(T3)"..strchar( 1 ).."$$"
   SendToAll(ScriptRestart)
   SendToAll(BotNameInfo)
   SendToAll(OpChatInfo)
   SetTimer(TimeSpanInMinutes*60000)
   StartTimer()
end

function OnTimer()
   SendAdMessage()
end

function SendAdMessage()
   upline = "~~~~~~~~~~~~H~U~=B~~S~T~A~T~S~~~~~~~~~~"
   underline = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
   hubstats = "\r\n\r\n"..upline.."\r\n"..
       "      ?Script Version:           "..Version.."\r\n"..
       "      ?Build:              "..Build.."\r\n"..
       "      ?Script Creator:              "..Creators.."\r\n"..
       "      ?Hub Name:               "..sHubName.."\r\n"..
       "      ?Hub Description:          "..sHubDesc.."\r\n"..
       "      ?Hub Adress:             "..HubAdress.."\r\n"..
       "      ?Web Adress:             "..WebAdress.."\r\n"..
       "      ?Owner:           "..HubOwner.."\r\n"..
       "      ?Online Users:          "..sUserCount.."\r\n"..
       "      ?Redirect Adress:          "..sRedirect.."\r\n"..
       "      ?Maximum Users:          "..sMaxUsers.."\r\n"..
       "      ?Hub Network:           !network".."\r\n"..
       "      ?Hub Rules:              !rules".."\r\n"..underline.."\r\n".." "

      SendToAll(BotName, hubstats)
end

function DataArrival(user,data)
      if (strsub(data,1,7) == "$MyINFO") then
         Tag,Speed,Share = Parse(data)
         TagCheck(Tag,Speed,Share,user)
      end

   if (strsub(data, 1, 1) == "<" ) and user.bOperator then
      data=strsub(data,1,strlen(data)-1)
      _,_,cmd=strfind(data, "%b<>%s+(%S+)")
      if not cmd then cmd = "0" end
      cmd = strlower(cmd)
      cmdprefix = strsub(cmd, 1,1)
      if cmdprefix == "!" or cmdprefix == "+" or cmdprefix == "#" or cmdprefix == "?" then
         cmd = strsub(cmd, 2,strlen(cmd))
         if cmd == "say" then
            _,_,as,message = strfind(data, "%b<>%s+%S+%s+(%S+)%s+(.+)")
            SendToAll(as, message)
            return 1
         end
      end

         if cmd == "myip" then
            user:SendData(BotName, "Your IP is *** "..user.sIP)
            return 0
         elseif cmd == "version" then
            user:SendData("The Script", "  "..Version ..Build .. Creators)
            return 0
         else
            user:SendData("wrong use read help menu you fool!")
            return 1
         end
      end
      if strsub(data, 1, 5) == "$To: " then
      local s,e,to,from,text = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$")
         if to == OpChat then
            if user.bOperator then
               local s,e,msg = strfind(text,"^%b<>%s+(.+)")
               OpChatRoom(user,msg)
            end
         end
      end
end

function NewUserConnected(user,data)
   Connected(user)    
end
OpConnected = NewUserConnected

function OpChatRoom(user,msg)
      local allprofiles = GetProfiles()
      local index, profile, index2, nick
      for index, profile in allprofiles do
         local users = GetUsersByProfile(profile)
         for index2, nick in users do
            local usr = GetItemByName(nick)
            if usr ~= nil then
               if user.sName == usr.sName then
               else
                  if usr.iProfile == 0 or usr.iProfile == 1 or usr.iProfile == 4 then
                     usr:SendData("$To: "..usr.sName.." From: "..OpChat.." $<"..user.sName.."> "..msg)
                  end
               end
            end
         end
      end
end

function BlockGuard(ip)
   local _,_,a,b,c,d = strfind(ip "(%d*).(%d*).(%d*).(%d*)")
   if ( tonumber(a) and tonumber(b) and tonumber (c) and tonumber (d) ) then
      local uip = Computer(ip)
      if uip then
         for ranger,comp in Guard do
            local _,_,r1,r2 = strfind(ranger, "(.*)-(.*)")
            r1 = ComputeIP(r1)
            r2 = ComputeIP(r2)
            if uip>=r1 and uip <=r2 then
               return 1,comp
            end
         end
      end
   end
end

function Computer(curIP)
   local _,_,a,b,c,d = strfind (curIP, "(%d+).(%d+).(%d+).(%d+)")
   return a*16777216 + b*65536 + c+256 + d
end

function DeComputeIP(cIP)
   local temp1 = mod(cIP,16777216)
   local temp2 = mod(temp1,65536)
   return (floor(cIP/16777216).."."..floor(temp1/65536).."."..floor(temp2/256).."."..floor(mod(temp2,256)))
end

function LoadGuard(table,file)
   local handle = openfile(file, "r")
   if (handle) then
    local line = read(handle)
    while line do
         s,e,ind,val = strfind( line, "(.*):(.*)")
         if ind and val then
            table[val]=ind
         end
         line = read(handle)
    end
     closefile(handle)
   end
end

i think i miss something on it
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Herodes

#3
a Gotcha was found .. :)
function DataArrival(user,data)
	if (strsub(data,1,7) == "$MyINFO") then
		Tag,Speed,Share = Parse(data)
		TagCheck(Tag,Speed,Share,user)
	end

	if (strsub(data, 1, 1) == "<" ) [b]and user.bOperator[/b] then
		data=strsub(data,1,strlen(data)-1)
		_,_,cmd=strfind(data, "%b<>%s+(%S+)")
		if not cmd then .. . . .

no wonder it would show up :)

ooh and please use the [ c o d e ](no spaces :) code in here [ / c o d e ](no spaces, again :) tag to post ur code so the tabbing is preserved ..

Themaster

it still don't work :S
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Herodes

I just noticed another Gotcha...
if cmd == "myip" then
	user:SendData(BotName, "Your IP is *** "..user.sIP)
	[b]return 0[/b] --- this needs to be      return 1
elseif cmd == "version" then
	user:SendData("The Script", " "..Version ..Build .. Creators)
	[b]return 0[/b] --- this needs to be      return 1
else
	user:SendData("wrong use read help menu you fool!")
	return 1
end

Themaster

i still miss something one it....

i Can't still not do it on a VIP User or Reg User
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

[UK]Madman

if (strsub(data, 1, 1) == "<" ) and user.bOperator then

=

If command is in main chat, and the user is an Operator then.....   So this will not recognise commands sent by anybody lower than an Operator, so VIPs or REGs would get no response.

Themaster

thx it help...now i just go on with my command ...

thx to you there are helping ;)
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

#9
assert(dofile("blade/Commands.lua"), "blade/Commands.lua not found")

are there some load code there load my command ore that line is good ????
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

tezlo

one major gotcha..
sUserCount = frmHub:GetUsersCount()
..
sCurrentShare = frmHub:GetCurrentShareAmount()

these change, but you only assign them once at script start, so you always get one value no matter how many people are _really online

Themaster

if (strsub(data, 1, 1) == "<" ) then
      data=strsub(data,1,strlen(data)-1)
      _,_,cmd=strfind(data, "%b<>%s+(%S+)")
      s,e,arg = strfind(data,"%b<>%s+%S+%s+(%S+)")
      local commands = Commands(user, data, cmd))
         local _,_,message=strfind(data, "%b<>%s+(.+)")
            return commands
         end
      end
   end
end

Why can't i load from my command file where i write all my command :s
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

SMF spam blocked by CleanTalk