PM shows in main, any 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

PM shows in main, any help?

Started by Reefa, 01 July, 2004, 14:07:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Reefa

Hi guys,

I'm still in the process of learning lua, but I hacked together a small script to open a text file, read the contents and post it in a pm.

The problem is it pm's you in main, I'm guessing it's due to the fact that it sends the request too quickly and doesn't have time to open a new pm window.

Anything I can do?

QuoteBot = "-=Info-Bot=-"

v1 = "Information"

file = "info.txt"

function Main()
--frmHub:RegBot(sBot)
end

function DataArrival(user, data)
if (strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
_,_,cmd=strfind(data, "%b<>%s+(%S+)")

if (cmd=="!goactive") then
ReadGoActive(user, data, cmd)
return 1
end
end
end

function ReadGoActive(user, data, cmd)
local release = ""
readfrom(file)
while 1 do
local line = read()
if (line == nil) then
break
else
release = release.."   "..line.."\r\n"
end
end
user:SendPM(Bot, "\r\n\r\n".." "..v1.." posted by Info-Bot ".."\r\n\r\n"..release)
readfrom()
end

Thanks :)

Reef

pHaTTy

general dc++ settings causes a problem soooo

function Main() 
  frmHub:RegBot(Bot)
end

/pha
Resistance is futile!

NightLitch

you must reg your bot or name it to another bot you have regged... otherwise it will send the PM in main... due to not be in userlist...

change:

function Main() 
--frmHub:RegBot(sBot) 
end

to

function Main() 
frmHub:RegBot(Bot) 
end

/NL
//NL

NightLitch

Damit Phatty I was first... lmao... hehe
//NL

Reefa

LOL!!! Thanks for the quick reply guys!

I didn't realise the bot *has* to be regged in order for the message to pop up from it, thought it would just pop up and display the bot name anyway :D

Ta ;)

SMF spam blocked by CleanTalk