Author Topic: Major problem running LUA-scripts  (Read 3929 times)

0 Members and 1 Guest are viewing this topic.

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Major problem running LUA-scripts
« on: 08 September, 2010, 12:33:46 »
Hi everyone!
I'm running Ptokax 0.4.1.2 in GUI version.
I've been trying to run some LUA 5.1-scripts, but i can't get it working.
In the scripts-menu, all scripts are checked, none has any syntax errors. The script memory usage menu shows all 3 scripts runningAs admin client, I can start, stop and reload any of those scripts, followed by the standard status message "*** admin restarted script: x.lua".

However, none of the script bots appear in the userlist, and i can't use the script's commands.
So far, I've tried RecordBot-v.0.95.lua, simpsons.lua, RecordBot.lua, Chat_History_1.03_L5.1.lua and some others.
Can anyone tell me why the scripts won't start? (In fact, the hub says, they are running, but still, the bots don't appear :( )

PtokaX forum

Major problem running LUA-scripts
« on: 08 September, 2010, 12:33:46 »

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 482
  • Karma: +209/-22
  • PtokaX developer
Re: Major problem running LUA-scripts
« Reply #1 on: 08 September, 2010, 15:30:17 »
(In fact, the hub says, they are running, but still, the bots don't appear :( )
Not all scripts are stupid and create bot, most of them don't have any good reason to do that  ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 753
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Major problem running LUA-scripts
« Reply #2 on: 08 September, 2010, 16:27:41 »
Agreed, bot creation almost always serves the purpose of sending PMs because many users have PMs blocked from users that are not online (i. e. in the userlist).
Everything could have been anything else and it would have just as much meaning.

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #3 on: 08 September, 2010, 22:43:34 »
Yeah well, but all scripts i tried use
Code: [Select]
frmHub:RegBot(bot.sBotName);and since the commands don't work, the script doesn't seem to be executed.

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 482
  • Karma: +209/-22
  • PtokaX developer
Re: Major problem running LUA-scripts
« Reply #4 on: 08 September, 2010, 23:14:26 »
Oh, in that case script should show error message. Because that are old lua api script not working on PtokaX 0.4.1.2  ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #5 on: 08 September, 2010, 23:37:14 »
Old? The scripts I tried are all LUA 5.1. Is there still a newer version?

Just to be sure, can you recommend me any script that is definitely working on the current up-to-date version of ptokax? That way, we can tell if it's a scripting problem or a hub-problem :)

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #6 on: 09 September, 2010, 15:55:11 »
hi again.
i tried your chathistory from http://forum.ptokax.org/index.php?topic=7335.0
and it's giving me some syntax errors:
1) comma after the last "end" (removed it)
2) last } seems to be surplus (removed it)
3) line 40: attempt to index global 'SetMan' (a nil value) (ok, i had to start the hub before trying to start the script)

still: the script is started, but i can't see anything working. chat history is not being sent to me after i log in.

like in all other scripts i tried, i can't use your commands

Code: [Select]
+delchat        Delete Single Chat Entry
+history        Get Chat History
+togglehistory  Toggle Chat History
+dayhistory      Chat History By Days
+chathelp        Chat History Help
+delete          Delete Chat History

what am i doing wrong  ???
« Last Edit: 09 September, 2010, 16:01:00 by Buhmann »

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #7 on: 09 September, 2010, 18:09:00 »
heya.
i got the chat history-script working. commands work fine.

however, i can only get the history by typing +history, but i don't get an automated PM or history list in main chat.

i followed your advice at http://forum.ptokax.org/index.php?topic=7335#msg70619 to setup the login auto-history per main chat, not per PM, but it doesn't work.

Can you tell me what i might be doing wrong? ...again? :D

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #8 on: 09 September, 2010, 18:58:02 »
update: everything is fine now. all problems solved :)
there was a syntax error in your post here: http://forum.ptokax.org/index.php?topic=7335#msg70619

Code: [Select]
Core.SendToNick(user.sNick,"<"..Cfg.Bot.."> "..add..GetChat(Cfg.History))
should be

Code: [Select]
Core.SendToNick(user.sNick,"<"..Cfg.Bot.."> "..GetChat(Cfg.History))

Offline kammikaze

  • Junior Member
  • **
  • Posts: 18
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #9 on: 16 September, 2010, 10:12:03 »
Hello, i have a problem with the scripts also, they work fine, all commands are working, but the scripts i added are not vissible for reg/vip and kvip, the only script that they can use is top ten. But the script guess game and helpdesk are not vissible for them while operators and higher have all the scripts i added to the hub. How can i set this. In the scripts i cannot find to set per profile(true/false) so thats why i think it must be in the hubsoft. Can anybody help me out?

PtokaX forum

Re: Major problem running LUA-scripts
« Reply #9 on: 16 September, 2010, 10:12:03 »