Need Help With This Script - Page 2
 

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

Need Help With This Script

Started by tamilzone, 22 December, 2003, 20:27:11

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

plop

just found a tiny error in the scripting.txt from ptokax.
GetItemByName(nick) - Returns user object of the nick
  nick - the nick of user.
should be.
GetItemByName(nick) - Returns user object of the nick, or returns nil if user is not in the hub.
  nick - the nick of user.

that hint from VidFamne was good but if you remove the end pipe you should always place it back later if data is send back out again.
the end pipe is | this character, so your SendPM line should be changed a little bit.
not a big error as many ppl forget it and it's actualy working without but it can cause problems.
user:SendPM(botname, "user "..name.." is sharing "..share1.." GB|")
thats all 2 it.
also take a look @ my pattern match howto, that should help you on the things you don't understand fully yet on strfind.
same simple english.

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 <----<<

((UKSN))shad_dow

#26
hello again plop and Kepp

right i get to stright to the prob cos ur all pretty busy :)

right , i sort of undstand this :- (based on plops strfind post from before)

s,e,whoTo,from,message = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")

so i tryed to take the command from main :-
if( strsub(data, 1, 1) == "<" ) then 
 
data=strsub(data,1,strlen(data)-1) 
 
s,e,cmd = strfind( data, "%b<>%s+(%S+)" )

and make pm only which i coded like this :-

if( strsub(data, 1, 1) == "<" ) then 
 
data=strsub(data,1,strlen(data)-1) 
 
s,e,cmd = strfind(data,"$To:%s+%S+(%s+)From:%s+%S+%s+$%b<>%s+")

but nowt happens so im stuck  ?(  ?(  ?(  ?(

i know ive gone wroung some where in the strfind command

please help
creator of Therapy-X? bot

tezlo

ad pipe..
data=strsub(data,1,strlen(data)-1)
this appeared in one of the first scripts ever posted here
since then almost every script's DataArrival starts with this line

data = strsub(data, 1, -2)
does the same a tiny bit faster

but usually a strfind follows..
and you can easily deal with the pipe there
local s, e, cmd, args = strfind(data, "^%b<> (%S+)%s?(.*)|$")

so really theres no need to remove it

VidFamne

QuoteOriginally posted by tezlo
data=strsub(data,1,strlen(data)-1)
this appeared in one of the first scripts ever posted here
since then almost every script's DataArrival starts with this line
Is it what they called to re-use code? ;D

((UKSN))shad_dow

ello again , thakns to all thats has help :)

right 1 simple little Q.  any body give me a idea how i would made the users share amount apper to all ops when a new user connects :) .. thank u all in advance :)
creator of Therapy-X? bot

SMF spam blocked by CleanTalk