why dont it PM?
 

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

why dont it PM?

Started by [SWE]henrik, 01 January, 2004, 08:28:48

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[SWE]henrik

hi all
can someone be nice and look at this script, its supposed to send data in PM when users type the tight command but astead it comes in main:(

I may otherwise need help whit how i do to get the .txt files go in PM, if theres a surtain way to add them in text folder

Thi is the script:

--ShowInfo v1.0 by latinmusic == poweroperator 18/04/2003
--Based on TrickerBot 2 by ?Ptaczek?
--Based on a few lines of DirtyBot made by Dirty Finger
--This script read several files from a table and display them to a single user when he type the appropiate command...
--The directory --> Files <-- must exist inside of PtokaX Script Directory...
--The files --> rules.txt, net.txt, logo.txt and news.txt <-- must exist inside Files Directory...
--Enjoy
BotName = "Acoustic & World Music Hub"
Files = {
      ["+help"] = "data/usercommands.txt",
      ["+rules"] = "txt/rules.txt", --If you're using DirtyBot, don't uncomment this line
      ["!account"] = "txt/account.txt",
      ["!register"] = "txt/register.txt",
      ["!offline"] = "txt/offline.txt",
--      ["+network"] = "Files/network.txt",
--      ["+posts"] = "Files/posts.txt",
--      ["+faq"] = "Files/faq.txt",
      ["!test1"] = "Files/test1.txt",
      ["!test2"] = "Files/text2.txt",
      ["?news"] = "Files/news.txt",
      ["?rarfile"] = "Files/rarfile.txt",
      ["?regler"] = "Files/regler.txt",
      ["?winrar"] = "Files/winrar.txt",
      ["?rippdvd"] = "Files/rippdvd.txt",
      ["?opfun"] = "Files/opfun.txt",
      ["?dvd2vcd"] = "Files/dvd2vcd.txt",
   }
function Main()
end
function DataArrival(user, data)
   if( strsub(data, 1, 1) == "<" ) then
      s,e,msg = strfind(data, "%b<> ([ -z]*)")
      for key, value in Files do
         if( strfind( strlower(msg), key) ) then
            txtToShow, x = gsub(value, "%b[]", user.sName)
            SendToAll( data )
            Show(user, TheFile)
            return 1
         end
      end
   end
end
function Show(user, TheFile)
   readfrom(txtToShow, "r")
   local message = ""
   while 1 do
      local line = read()
      if line == nil then break
      else
         message = message..line.."\r\n"
      end
   end
   user:SendPM(BotName, message)
   readfrom()
end

Ill be very thankfull if anybody could take a look at this
Acoustic & World Music
jokiboxII.no-ip.info

pHaTTy

SendToAll( data )


hmmmm ;)
Resistance is futile!

[SWE]henrik

QuoteOriginally posted by (uk-kingdom)pH?tt?
SendToAll( data )


hmmmm ;)

thanks for the hint my friend, you leave me in the blue cause i realy dont know how to change in a script o then i just go right to it and mess it up, ehehehe.
Ill be very happy to see you quote this script complete to me, ive seen you done some other times;) otherwise i just try to delete that line and see if its working, anyway i promice you to give you a big hug if this work.
Ill almost et divorced in this issue,lol
have a nice day
Acoustic & World Music
jokiboxII.no-ip.info

Intel

#3
I guess it should be like this :
--ShowInfo v1.0 by latinmusic == poweroperator 18/04/2003 
--Based on TrickerBot 2 by ?Ptaczek? 
--Based on a few lines of DirtyBot made by Dirty Finger 
--This script read several files from a table and display them to a single user when he type the appropiate command... 
--The directory --> Files <-- must exist inside of PtokaX Script Directory... 
--The files --> rules.txt, net.txt, logo.txt and news.txt <-- must exist inside Files Directory... 
--Enjoy 
BotName = "Acoustic & World Music Hub" 
Files = { 
["+help"] = "data/usercommands.txt", 
["+rules"] = "txt/rules.txt", --If you're using DirtyBot, don't uncomment this line 
["!account"] = "txt/account.txt", 
["!register"] = "txt/register.txt", 
["!offline"] = "txt/offline.txt", 
-- ["+network"] = "Files/network.txt", 
-- ["+posts"] = "Files/posts.txt", 
-- ["+faq"] = "Files/faq.txt", 
["!test1"] = "Files/test1.txt", 
["!test2"] = "Files/text2.txt", 
["?news"] = "Files/news.txt", 
["?rarfile"] = "Files/rarfile.txt", 
["?regler"] = "Files/regler.txt", 
["?winrar"] = "Files/winrar.txt", 
["?rippdvd"] = "Files/rippdvd.txt", 
["?opfun"] = "Files/opfun.txt", 
["?dvd2vcd"] = "Files/dvd2vcd.txt", 
} 
function Main() 
end 
function DataArrival(user, data) 
if( strsub(data, 1, 1) == "<" ) then 
s,e,msg = strfind(data, "%b<> ([ -z]*)") 
for key, value in Files do 
if( strfind( strlower(msg), key) ) then 
txtToShow, x = gsub(value, "%b[]", user.sName) 
SendToAll( data ) 
Show(user, TheFile) 
return 1 
end 
end 
end 
end 
function Show(user, TheFile) 
readfrom(txtToShow, "r") 
local message = "" 
while 1 do 
local line = read() 
if line == nil then break 
else 
message = message..line.."\r\n" 
end 
end 
user:SendToAll( data )
readfrom() 
end
Punnakku

[SWE]henrik

QuoteOriginally posted by Intel
I guess it should be like this :
--ShowInfo v1.0 by latinmusic == poweroperator 18/04/2003 
--Based on TrickerBot 2 by ?Ptaczek? 
--Based on a few lines of DirtyBot made by Dirty Finger 
--This script read several files from a table and display them to a single user when he type the appropiate command... 
--The directory --> Files <-- must exist inside of PtokaX Script Directory... 
--The files --> rules.txt, net.txt, logo.txt and news.txt <-- must exist inside Files Directory... 
--Enjoy 
BotName = "Acoustic & World Music Hub" 
Files = { 
["+help"] = "data/usercommands.txt", 
["+rules"] = "txt/rules.txt", --If you're using DirtyBot, don't uncomment this line 
["!account"] = "txt/account.txt", 
["!register"] = "txt/register.txt", 
["!offline"] = "txt/offline.txt", 
-- ["+network"] = "Files/network.txt", 
-- ["+posts"] = "Files/posts.txt", 
-- ["+faq"] = "Files/faq.txt", 
["!test1"] = "Files/test1.txt", 
["!test2"] = "Files/text2.txt", 
["?news"] = "Files/news.txt", 
["?rarfile"] = "Files/rarfile.txt", 
["?regler"] = "Files/regler.txt", 
["?winrar"] = "Files/winrar.txt", 
["?rippdvd"] = "Files/rippdvd.txt", 
["?opfun"] = "Files/opfun.txt", 
["?dvd2vcd"] = "Files/dvd2vcd.txt", 
} 
function Main() 
end 
function DataArrival(user, data) 
if( strsub(data, 1, 1) == "<" ) then 
s,e,msg = strfind(data, "%b<> ([ -z]*)") 
for key, value in Files do 
if( strfind( strlower(msg), key) ) then 
txtToShow, x = gsub(value, "%b[]", user.sName) 
SendToAll( data ) 
Show(user, TheFile) 
return 1 
end 
end 
end 
end 
function Show(user, TheFile) 
readfrom(txtToShow, "r") 
local message = "" 
while 1 do 
local line = read() 
if line == nil then break 
else 
message = message..line.."\r\n" 
end 
end 
user:SendToAll( data )
readfrom() 
end

im realy thankfull for this but theres a syntax:
Syntax Error: attempt to call field `SendToAll' (a nil value)
Maybe something abouth what phatty try to tell me, hehe
Acoustic & World Music
jokiboxII.no-ip.info

[NL]trucker

[SWE]henrik

first of all these wont be shown because they are in the wrong folder:

["+help"] = "data/usercommands.txt",
["+rules"] = "txt/rules.txt", --If you're using DirtyBot, don't uncomment this line
["!account"] = "txt/account.txt",
["!register"] = "txt/register.txt",
["!offline"] = "txt/offline.txt",

--The directory --> Files <-- must exist inside of PtokaX Script Directory...
--The files --> rules.txt, net.txt, logo.txt and news.txt <-- must exist inside Files Directory...

you have put them in a dir data and txt so it will not work unless your main script takes over that part and then it is not neccesary to add them in this script anyway.

asfar as your question i think phatty meant that you had to replace

SendToAll( data )

with

SendToNick(curUser.sName) or
SendPmTo(curUser.sName)

first shows message in main to user and second sends pm to user.

try it and if i,m wrong i,m sure some of the fine scripters here can help you further.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


pHaTTy

SendToAll( data )


remove it ;)
Resistance is futile!

[NL]trucker

LoooOOOoooool


gues i still need some more time learning this stuff.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[SWE]henrik

QuoteOriginally posted by (uk-kingdom)pH?tt?
SendToAll( data )


remove it ;)

thanks phatty, now it comes in main any way at least im back where i started;)
this is shown in main:
Private message from Acoustic & World Music Hub: this is test from folder text.but still it doesnt come up in a PM like rules do...
what do i do wrong? i put that a .txt doc in
a, script folder along whit the scripts
b, data folder along whit other data
c, text folder along whit other text files...
this is the changes ive done in script exept removed send to all:
{
["+help"] = "data/usercommands.txt",
["+rules"] = "txt/rules.txt", --If you're using DirtyBot, don't uncomment this line
["!account"] = "txt/account.txt",
["!register"] = "txt/register.txt",
["!test"] = "txt/test.txt",
-- ["+network"] = "Files/network.txt",
-- ["!test"] = "Files/test.txt",
-- ["+faq"] = "Files/faq.txt",
["!test"] = "Files/test.txt",
["!test"] = "Files/text.txt",
["?news"] = "Files/news.txt",
["?rarfile"] = "Files/rarfile.txt",
["?regler"] = "Files/regler.txt",
["?winrar"] = "Files/winrar.txt",
["?rippdvd"] = "Files/rippdvd.txt",
["?opfun"] = "Files/opfun.txt",
["?dvd2vcd"] = "Files/dvd2vcd.txt",
}
...
im sometimes now (like this realy) think ill manege to solve this problem whit your help;)
Acoustic & World Music
jokiboxII.no-ip.info

[NL]trucker

[SWE]henrik



first of all these wont be shown because they are in the wrong folder:

["+help"] = "data/usercommands.txt",["+rules"] = "txt/rules.txt", --If you're using DirtyBot, don't uncomment this line

 -- i,ll guess the above ones  are handled by the mainscript so no need to add them here.--


["!account"] = "txt/account.txt",
["!register"] = "txt/register.txt",
["!offline"] = "txt/offline.txt",

--The directory --> Files <-- must exist inside of PtokaX Script Directory...
--The files --> rules.txt, net.txt, logo.txt and news.txt <-- must exist inside Files Directory...
 


["!test"] = "Files/test.txt",
["!test"] = "Files/text.txt",


hmmm 2x !test for diffrent messages?

this wont work either[wrong folder]

["!test"] = "txt/test.txt",

this one will not work

-- ["!test"] = "Files/test.txt",

A. you commented it out by putting -- in front of line
B. it is not in the right dir e.g.
ptotaxdir/scripts/Files

is the file dir like this: Files or like this:  files?

and as last what is the main script you use?
this because you use three diffrent prefixes in this bot and i can imagine it interferes with your mainbot.

to make sure wich txt file is showing make them say the foldername there in.

like this is txt from data folder
      this is txt from files folder
      this is txt from data folder
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


NightLitch

#10
this is so simple that many seems to forget...

function Main()
frmHub:RegBot(BotName)
end


should be in script... then it works with your PM

code here if you're lazy ;-)

--ShowInfo v1.0 by latinmusic == poweroperator 18/04/2003 
--Based on TrickerBot 2 by ?Ptaczek? 
--Based on a few lines of DirtyBot made by Dirty Finger 
--This script read several files from a table and display them to a single user when he type the appropiate command... 
--The directory --> Files <-- must exist inside of PtokaX Script Directory... 
--The files --> rules.txt, net.txt, logo.txt and news.txt <-- must exist inside Files Directory... 
--Enjoy 
BotName = "Acoustic & World Music Hub" 
Files = { 
["+help"] = "data/usercommands.txt", 
["+rules"] = "txt/rules.txt", --If you're using DirtyBot, don't uncomment this line 
["!account"] = "txt/account.txt", 
["!register"] = "txt/register.txt", 
["!offline"] = "txt/offline.txt", 
-- ["+network"] = "Files/network.txt", 
-- ["+posts"] = "Files/posts.txt", 
-- ["+faq"] = "Files/faq.txt", 
["!test1"] = "Files/test1.txt", 
["!test2"] = "Files/text2.txt", 
["?news"] = "Files/news.txt", 
["?rarfile"] = "Files/rarfile.txt", 
["?regler"] = "Files/regler.txt", 
["?winrar"] = "Files/winrar.txt", 
["?rippdvd"] = "Files/rippdvd.txt", 
["?opfun"] = "Files/opfun.txt", 
["?dvd2vcd"] = "Files/dvd2vcd.txt", 
} 
function Main() 
frmHub:RegBot(BotName) 
end 
function DataArrival(user, data) 
if( strsub(data, 1, 1) == "<" ) then 
s,e,msg = strfind(data, "%b<> ([ -z]*)") 
for key, value in Files do 
if( strfind( strlower(msg), key) ) then 
txtToShow, x = gsub(value, "%b[]", user.sName) 
SendToAll( data ) 
Show(user, TheFile) 
return 1 
end 
end 
end 
end 
function Show(user, TheFile) 
readfrom(txtToShow, "r") 
local message = "" 
while 1 do 
local line = read() 
if line == nil then break 
else 
message = message..line.."\r\n" 
end 
end 
user:SendPM(BotName,message)
readfrom() 
end

hope it works now... Otherwise I try fix it...
//NL

NightLitch

gaaaa... ehehe forgot to put in the short code myself...

ehehe

Above code updated...
//NL

pHaTTy

haha im was tired and lazy i didnt even see it was not registering the botname hahah :))

note: reason it does not work without botname is because its a cleint problem, nmdc it will work but dc++/odc it wont, they check if user is in list, i guess its to stop spam or something
Resistance is futile!

[SWE]henrik

QuoteOriginally posted by NightLitch
gaaaa... ehehe forgot to put in the short code myself...

ehehe

Above code updated...

yeeeeeeeeeeeeees, it works :))
just one problem that i assume is easy to help out, now ive got a PM from magicpm that i call the bot now but lol all that stands in there is:

*** User went online [magicpm ()] ***


hrm... ive create an folder called test1 that ive typed "work now god dammed" and put that in to the txt folder among whit other folders (rules, network and those who are there from the beginning... But still ive just got the PM above when i type !test1 in main
can you help me out here mate?
Acoustic & World Music
jokiboxII.no-ip.info

pHaTTy

i dont understadn what you mean :/
Resistance is futile!

SMF spam blocked by CleanTalk