PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Help with scripts => Topic started by: Buhmann on 08 September, 2010, 12:33:46

Title: Major problem running LUA-scripts
Post by: Buhmann 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 :( )
Title: Re: Major problem running LUA-scripts
Post by: PPK on 08 September, 2010, 15:30:17
Quote from: Buhmann on 08 September, 2010, 12:33:46
(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  ::)
Title: Re: Major problem running LUA-scripts
Post by: bastya_elvtars 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).
Title: Re: Major problem running LUA-scripts
Post by: Buhmann on 08 September, 2010, 22:43:34
Yeah well, but all scripts i tried use
frmHub:RegBot(bot.sBotName);
and since the commands don't work, the script doesn't seem to be executed.
Title: Re: Major problem running LUA-scripts
Post by: PPK 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  ::)
Title: Re: Major problem running LUA-scripts
Post by: Buhmann 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 :)
Title: Re: Major problem running LUA-scripts
Post by: Buhmann 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

+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  ???
Title: Re: Major problem running LUA-scripts
Post by: Buhmann 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
Title: Re: Major problem running LUA-scripts
Post by: Buhmann 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

Core.SendToNick(user.sNick,"<"..Cfg.Bot.."> "..add..GetChat(Cfg.History))

should be

Core.SendToNick(user.sNick,"<"..Cfg.Bot.."> "..GetChat(Cfg.History))
Title: Re: Major problem running LUA-scripts
Post by: kammikaze 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?