PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: -Slash- on 07 May, 2005, 13:43:40

Title: problem with profiles ofRobocop 10.01e
Post by: -Slash- on 07 May, 2005, 13:43:40
i have ptokax 0.3.3.0 build 17.03 but the profiles of robocop 10.01e don't run!
why?can u solve my problem?
thanks
ptokax rulez! :D
Title:
Post by: Tw?sT?d-d?v on 07 May, 2005, 13:46:21
- IMPORTANT:

Install the provided Profiles.xml but before you do that you need to close your hub. Other it will not work.

1.) You can find the Robocop Profiles.xml file in folder script/profiles/PtokaX 16.07 or higher.
2.) Put the Robocop Profiles.xml file in folder ptokaxprogramfolder/cfg/
3.) your done, start up your hub

-----------------------------------------------------------------------------------------------------------------------

If you are still having problems running robocop.exe then download microsoft frameworks 1.1 SP1.
Install the version in the language your windows is

http://www.microsoft.com/downloads/details.aspx?FamilyID=262d25e3-f589-4842-8157-034d1e7cf3a3&displaylang=en
Title:
Post by: -Slash- on 07 May, 2005, 13:52:48
thanks i haven't put the profile in the folder cfg but only in the ptokax folder as with the old ptokax!
an other question...this new ptokax is lighter than the build 15.18 ?
Title:
Post by: 6Marilyn6Manson6 on 07 May, 2005, 14:04:13
QuoteOriginally posted by -Slash-
thanks i haven't put the profile in the folder cfg but only in the ptokax folder as with the old ptokax!
an other question...this new ptokax is lighter than the build 15.18 ?

With a 256k in upload you stand 100 users in more without problems ... c ya
Title:
Post by: -Slash- on 07 May, 2005, 14:48:33
i've modded some scripts lua4 to lua5 and they yesterday ran without robocop...instead when i load robocop some of these script don't run...
why?
thanks
Title:
Post by: 6Marilyn6Manson6 on 07 May, 2005, 15:03:06
QuoteOriginally posted by -Slash-
i've modded some scripts lua4 to lua5 and they yesterday ran without robocop...instead when i load robocop some of these script don't run...
why?
thanks

What are this scripts?
Title:
Post by: -Slash- on 07 May, 2005, 15:07:49
scripts like chat history or in&out phrase sender
i converted it looking that
    |
    |
    |
    V  

;User conversion definition file for PSPad editor
[Description]
;name for Left to Right conversion
ForwardName=LUA 4 to 5
;name for Right to Left conversion
BackwardName=LUA 5 to 4
;ignore char case
ForwardIgnoreCase=0
BackWardIgnoreCase=0
;CharTab=0 - convertor will use string replacement from [Conversion] section
;CharTab=1 - convertor will use conversion table from section
CharTab=0
;expresion from|expresion to
[Conversion]
;functions
DataArrival|ChatArrival
;stringstuff
strfind|string.find
strsub|string.sub
gsub|string.gsub
strchar|string.char
strbyte|string.byte
strlen|string.len
strlower|string.lower
strrep|string.rep
strupper|string.upper
format|string.format
;tablestuff
tinsert|table.insert
tremove|table.remove
concat|table.concat
foreach|table.foreach
foreachi|table.foreachi
getn|table.getn
sort|table.sort
setn|table.setn
;mathstuff
abs|math.abs
acos|math.acos
asin|math.asin
atan|math.atan
atan2|math.atan2
ceil|math.ceil
cos|math.cos
deg|math.deg
exp|math.exp
floor|math.floor
log|math.log
log10|math.log10
max|math.max
min|math.min
mod|math.mod
pow|math.pow
rad|math.rad
sin|math.sin
sqrt|math.sqrt
tan|math.tan
frexp|math.frexp
ldexp|math.ldexp
random|math.random
randomseed|math.randomseed
pi|math.pi
;osstuff
date|os.date
execute|os.execute
clock|os.clock
remove|os.remove
Title:
Post by: SlasH on 07 May, 2005, 19:21:56
HI -Slash-
welcome

SlasH

HeHE
Title:
Post by: -Slash- on 08 May, 2005, 16:58:06
noooooo
an other slash!!!!
oh my god!!!
here it'is too small for 2 slash!!!
muahahah

'm joking :P
NICE TO MEET 'U!!!
Title:
Post by: -Slash- on 09 May, 2005, 14:43:06
marylin could u look what don't work at this script please?
PS:i'm italian,arent' u?

-- Script by LadyToastKill and nightblade

--nome bot tra doppi apici
BotName="•Ricordi...•"

--aggiornare il valore qui sotto mettendo il numero di mess presenti nel file memories.txt + n
memoriesline=13

-- tempo che deve trascorrere tra un mess e l'altro in minuti
TimeSpanInMinutes = 1
--comandi
Command1="!parla"
Command2="!zitto"

trigall=1

function Main()
   SetTimer(TimeSpanInMinutes*60000)
   StartTimer()
end

function GetCommand(message)
   s,e,command=string.find(message,"(%S+)")
   return command
end
function GetOneParam(message)
   s,e,param1=string.find(message,"%S+%s(.*)")
   return param1
end

function ChatArrival(curUser, data)
   if( string.sub(data, 1, 1) == "<" ) then
      status=string.sub(data,1,string.len(data)-1)
      a,b,cmd = string.find( status, "%b<>%s+(%S+)" )
      if cmd==Command1 and curUser.bOperator then
      curUser:SendData(BotName,"Io parlo quanto mi pare e piace capito???")
      trigall=1
      StartTimer()
      return 1
      elseif cmd==Command2 and curUser.bOperator then
      curUser:SendData(BotName, "Muto sono, capisti?")
      trigall=0
      StopTimer()
      return 1
      elseif cmd=="!memories" and trigall==1 and curUser.bOperator then
      countline=1
      numberline=math.math.random(1,memoriesline)
      readfrom("memories.txt")
      while 1 do
      line = read()
         if line == nil then
         break
         end
         if countline==numberline then
         SendToAll(BotName,line)
         break
         end
      countline=countline+1      
      end
      readfrom()
      end
      data=string.sub(data,1,string.len(data)-1)
      s,e,message = string.find( data, "%b<>%s+(.*)")
      command=GetCommand(message)            
           if command=="!addmemories" and curUser.bOperator then
            text=GetOneParam(message)
            if text~=nil then
               local file=openfile("memories.txt","a")
               write(file,text.."\n")
               closefile(file)
               SendToAll(BotName,"Aggiunta nuova memories... Chi sar? il fortunato???")
                        curUser:SendPM(BotName,"Memories aggionato..")   
               return 1
            else
               curUser:SendPM(BotName,"Hai cannato qualcosa la sintassi corretta : !addmemories frase")
            end
          end
   end
end

function OnTimer()
   if trigall==1 then
   countline=1
   numberline=math.math.random(1,memoriesline)
   readfrom("memories.txt")
   while 1 do
      line = read()
      if line == nil then
      break
      end
      if countline==numberline then
      SendToAll(BotName,line)
      break
      end
      countline=countline+1      
   end
   readfrom()
   end
end
Title:
Post by: 6Marilyn6Manson6 on 09 May, 2005, 16:05:28
I'm Italian DUDE ;)

-- Script by LadyToastKill and nightblade
-- nome bot tra dopmath.pi apici
-- Fixed bug with addmemories and loadfile by 6Marilyn6Manson6

BotName="[ITA]MeMories"

--aggiornare il valore qui sotto mettendo il numero di mess presenti nel file memories.txt + n
memoriesline=13

-- tempo che deve trascorrere tra un mess e l'altro in minuti
TimeSpanInMinutes = 1

--comandi
Command1="!parla"
Command2="!zitto"

trigall=1

function Main()
frmHub:RegBot(BotName)
SetTimer(TimeSpanInMinutes*60000)
StartTimer()
end

function GetCommand(message)
s,e,command=string.find(message,"(%S+)")
return command
end

function GetOneParam(message)
s,e,param1=string.find(message,"%S+%s(.*)")
return param1
end

function ChatArrival(curUser, data)
if( string.sub(data, 1, 1) == "<" ) then
status=string.sub(data,1,string.len(data)-1)
a,b,cmd = string.find( status, "%b<>%s+(%S+)" )
if cmd==Command1 and curUser.bOperator then
curUser:SendData(BotName,"Io parlo quanto mi pare e piace capito???")
trigall=1
StartTimer()
return 1
elseif cmd==Command2 and curUser.bOperator then
curUser:SendData(BotName, "Muto sono, capisti?")
trigall=0
StopTimer()
return 1
elseif cmd=="!memories" and trigall==1 and curUser.bOperator then
countline=1
numberline=math.random(1,memoriesline)
readfrom("memories.txt")
while 1 do
if line == nil then
break
end
if countline==numberline then
SendToAll(BotName,line)
break
end
countline=countline+1
end
readfrom()
end
data=string.sub(data,1,string.len(data)-1)
s,e,message = string.find( data, "%b<>%s+(.*)")
command=GetCommand(message)
if command=="!addmemories" and curUser.bOperator then
text=GetOneParam(message)
if text~=nil then
local file=io.open("memories.txt","a")
file:write(text.."\n")
file:close()
SendToAll(BotName,"Aggiunta nuova memories... Chi sar? il fortunato???")
curUser:SendPM(BotName,"Memories aggionato..")
return 1
else
curUser:SendPM(BotName,"Hai cannato qualcosa la sintassi corretta : !addmemories frase")
end
end
end
end

function OnTimer()
if trigall==1 then
countline=1
numberline=math.random(1,memoriesline)
local handle = io.open("memories.txt","r")
while 1 do
if line == nil then
break
end
if countline==numberline then
SendToAll(BotName,line)
break
end
countline=countline+1
end
handle:close()
end
end

try this... post error c ya
Title:
Post by: -Slash- on 09 May, 2005, 19:30:25
mmmm
there's a problem with the readfrom

memories.lua:103: attempt to call global `readfrom' (a nil value)
Title:
Post by: 6Marilyn6Manson6 on 09 May, 2005, 22:01:22
QuoteOriginally posted by -Slash-
mmmm
there's a problem with the readfrom

memories.lua:103: attempt to call global `readfrom' (a nil value)

Script have 101 lines ^^
Title:
Post by: -Slash- on 09 May, 2005, 22:07:39
yes but.... (il mio script ? fatto un rigo si e uno no...nun te lo so scrive in inglese :P) i will delete the unnecessary spaces and tell u what is the line :D
Title:
Post by: 6Marilyn6Manson6 on 09 May, 2005, 22:09:03
QuoteOriginally posted by -Slash-
yes but.... (il mio script ? fatto un rigo si e uno no...nun te lo so scrive in inglese :P) i will delete the unnecessary spaces and tell u what is the line :D

Post your script of 103 lines or plus ;)
Title:
Post by: -Slash- on 09 May, 2005, 22:14:21
ther's one error becaure is repeated 3 times the world math. ---> math.math.math.random(1,memoriesline)

it is my LONG script ;)

-- Script by LadyToastKill and nightblade

-- nome bot tra dopmath.pi apici

-- Fixed bug with addmemories and loadfile by 6Marilyn6Manson6



BotName="[ITA]MeMories"



--aggiornare il valore qui sotto mettendo il numero di mess presenti nel file memories.txt + n

memoriesline=13



-- tempo che deve trascorrere tra un mess e l'altro in minuti

TimeSpanInMinutes = 1



--comandi

Command1="!parla"

Command2="!zitto"



trigall=1



function Main()

frmHub:RegBot(BotName)

SetTimer(TimeSpanInMinutes*60000)

StartTimer()

end



function GetCommand(message)

s,e,command=string.find(message,"(%S+)")

return command

end



function GetOneParam(message)

s,e,param1=string.find(message,"%S+%s(.*)")

return param1

end



function ChatArrival(curUser, data)

if( string.sub(data, 1, 1) == "<" ) then

status=string.sub(data,1,string.len(data)-1)

a,b,cmd = string.find( status, "%b<>%s+(%S+)" )

if cmd==Command1 and curUser.bOperator then

curUser:SendData(BotName,"Io parlo quanto mi pare e piace capito???")

trigall=1

StartTimer()

return 1

elseif cmd==Command2 and curUser.bOperator then

curUser:SendData(BotName, "Muto sono, capisti?")

trigall=0

StopTimer()

return 1

elseif cmd=="!memories" and trigall==1 and curUser.bOperator then

countline=1

numberline=math.random(1,memoriesline)

readfrom("memories.txt")

while 1 do

if line == nil then

break

end

if countline==numberline then

SendToAll(BotName,line)

break

end

countline=countline+1

end

readfrom()

end

data=string.sub(data,1,string.len(data)-1)

s,e,message = string.find( data, "%b<>%s+(.*)")

command=GetCommand(message)

if command=="!addmemories" and curUser.bOperator then

text=GetOneParam(message)

if text~=nil then

local file=io.open("memories.txt","a")

file:write(text.."\n")

file:close()

SendToAll(BotName,"Aggiunta nuova memories... Chi sar? il fortunato???")

curUser:SendPM(BotName,"Memories aggionato..")

return 1

else

curUser:SendPM(BotName,"Hai cannato qualcosa la sintassi corretta : !addmemories frase")

end

end

end

end



function OnTimer()

if trigall==1 then

countline=1

numberline=math.random(1,memoriesline)

local handle = io.open("memories.txt","r")

while 1 do

if line == nil then

break

end

if countline==numberline then

SendToAll(BotName,line)

break

end

countline=countline+1

end

handle:close()

end

end
Title:
Post by: 6Marilyn6Manson6 on 09 May, 2005, 22:40:18
OPs sorry for error
Title:
Post by: -Slash- on 09 May, 2005, 22:49:48
dont' worry
but there is the error to line 103 "readfrom" i can't individualize it...
Title:
Post by: 6Marilyn6Manson6 on 09 May, 2005, 23:25:08
QuoteOriginally posted by -Slash-
dont' worry
but there is the error to line 103 "readfrom" i can't individualize it...

Use [ CODE] and [ /CODE] without space and post your script with error
Title:
Post by: -Slash- on 09 May, 2005, 23:33:21
i've posted before
Title:
Post by: 6Marilyn6Manson6 on 09 May, 2005, 23:39:37
QuoteOriginally posted by -Slash-
i've posted before

Use code... in this mode .... don't find line 103 ;)
Title:
Post by: -Slash- on 10 May, 2005, 14:36:50
ptokax tell that the error is ------>>  readfrom("memories.txt")

it seems impossible...memories.txt already exist!
Title:
Post by: -Slash- on 10 May, 2005, 16:43:29
mmmm
but the "readfrom" from lua4 to lua5 is the same or it needs to be written in a diffrent way?

like gsub--->string.gsub