Some One Please Check This .... Im Confused
 

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

Some One Please Check This .... Im Confused

Started by ((UKSN))shad_dow, 31 January, 2004, 14:21:44

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

((UKSN))shad_dow

hi chilla , Plop , Phatty , Kepp , tezlo
and Nightlitch

hope ya can help me please.

if (cmd == "+ipbann" ) then
	IpBanN(user, data,cmd)

                                return 1
			end


function IpBanN(user, data,cmd)

         s,e,cmd,Ip = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s+.+")
			local UserIp = Ip
		               UserIp:Ban()
			SendToAll(Bot, " IP "..UserIp " has been  banned ")
			end

Syntax Error: attempt to index local `Ip' (a nil value)

right 1) tryed to create the strfind with the little guide i got from plop .. but me thinks i aint got it quite right  and its not getting the value  

or

2) this line is wrong> local UserIp = Ip  

or

3) ive missed a bit of code out (hand coded stright from my mem)

please help as im confused as what to do

creator of Therapy-X? bot

pHaTTy

first of all go check the hows goto lesson 1 on writing a bot, so you can understand the data arrival process and as for banip i not sure there is an external command for that, i think you have to ban the with ip im not to sure :/
Resistance is futile!

((UKSN))shad_dow

cheers phatty , think i go over the lessons again , good job i printed them out :) ...

shame ther aint a way to !ipban ip and it just ban the ip u typed in , just like the hub does ??? mmmm

thats all i was doing seeing if i could code in to a script the same commands as in ptokax , just using diffent prefix .. thourght it might make me better @ coding :)

ps.. thank u for ur quick responce :)
creator of Therapy-X? bot

kepp

#3
have you tried "Ban(UserIp)"?

HINT:

I want to find "0.54.1"

local s,e,cmd,IP = strfind(data,"%b<>%s+(%d.%d+.%d)")

%d = numbers

Now go try :P
Guarding    

pHaTTy

QuoteOriginally posted by kepp
have you tried "Ban(UserIp)"?


that shudnt work :S, if it does you tought me sumit new :)
Resistance is futile!

plop

banning ip's is imposible from the scripts.

kepp you can do this easyer.
local s,e,cmd,IP = strfind(data,"%b<>%s+(%d.%d+.%d)")
replace for.

local s,e,cmd,IP = strfind(data,"%b<>%s+(%S+)%s+([%d%.]+)")

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

kepp

ok, lol, i've never tried myself.. ,
That reminds me of something, I gotta check that post of your again! :)
Guarding    

SMF spam blocked by CleanTalk