Please 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

Please help! =)

Started by Glidaren, 24 October, 2003, 19:16:42

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Glidaren

Hellu! =)

I need some help.
My bot sends the rule message like thise
Thise is the hub rules:
Rule 1
Rule 2
Rule 3
Rule 4
Rule 5
Rule 6
Rule 7
Rule 8

And i whant it to send like thise:

Thise is the hub rules:
Rule 1
Rule 2
Rule 3
Rule 4
Rule 5
Rule 6
Rule 7
Rule 8

Any ide?
One HubSoft to rule them all! :D
Dude wheres my script?  ;)

servaks

Try this one..

trigger = "!rules"
file = "rules.txt"
botname = "Rules bot"

function Main()
frmHub:RegBot(botname)
end

function ReadRulesFile(user, theFile) 
local handle = openfile(theFile, "r") 
if (handle ~= nil) then 
local line = read(handle) 
while line do 
user:SendPM(botname,line) 
line = read(handle) 
end 
closefile(handle) 
end 
end

function DataArrival(user, data)
if (strsub(data,1,1)=="<") then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == trigger then 
ReadRulesFile(user, file) 
return 1
end
end
end

/shipis
My hub is back! (yeeeeeey)

hub.servaks.com


Glidaren

Thanks but i have all the text in an lua file  :)
How do i do then?
One HubSoft to rule them all! :D
Dude wheres my script?  ;)

servaks

rewrite rules text in TXT file
My hub is back! (yeeeeeey)

hub.servaks.com


Glidaren

But is there no way to make it possible in an lua file?
One HubSoft to rule them all! :D
Dude wheres my script?  ;)

servaks

wow

pardon...

the script is not working lol...
maby use "\r\n" after each line...
Priew:
SendData:(bot, "ruule1"\r\n"rule2"\r\n)

/shipis
My hub is back! (yeeeeeey)

hub.servaks.com


Glidaren

I made an TXT file insted but it didnt work =/ its still

rule1
rule2
rule3
rule4
rule5
rule6
rule7

 :(
One HubSoft to rule them all! :D
Dude wheres my script?  ;)

servaks

Maby try this...

trigger = "!rules"
file = "rules.txt"
botname = "Rules bot"

function Main()
frmHub:RegBot(botname)
end

function DataArrival(user, data)
if (strsub(data,1,1)=="<") then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == trigger then 
ReadRulesFile(user, file) 
return 1
end
end
end

function ReadRulesFile(user, theFile) 
readfrom(file) 
local motdmessage = "" 
while 1 do 
local line = read() 
if (line == nil) then break else 
motdmessage = motdmessage..line.."\r\n" 
end
end
end
My hub is back! (yeeeeeey)

hub.servaks.com


MrZ

Hia:))

Wich script are ya using???
If its one of em in here, pls tell us. If ya wrote it yaself or its not one of em in here pls paste it in here (as code).

Z ya
Always remember that you are unique... just like everyone else :-D

SMF spam blocked by CleanTalk