Hello Guest

loadscript

  • 7 Replies
  • 1098 Views
*

lilou69

  • **
  • 10
  • +0/-0
    • View Profile
loadscript
« on: April 16, 2018, 08:46:56 am »
Hi seuntjie
Please can you help me
I make a script in .lua
In dicebot i'm writting loadscript(nameofthescript) and I have LUA ERROR!!
[string "chunk"]:1: attempt to call global 'executefile' (a nil value)
But if i copy cut the script direct in dicebot it's work ?
Where I have to give the script for it work ?
I try all the function
doscript(....)
executscript(....)
And really dont know how to do for dicebot read my script ....
Thanks in advance

*

Seuntjie

  • *****
  • 138
  • +0/-1
    • View Profile
Re: loadscript
« Reply #1 on: April 16, 2018, 11:14:02 am »
Please take a look at the tutorials on https://forum.seuntjie.com/index.php?topic=2.0, specifically the last youtube tutorial.

*

lilou69

  • **
  • 10
  • +0/-0
    • View Profile
Re: loadscript
« Reply #2 on: April 17, 2018, 11:43:54 am »
Thanks for the replu seuntjie, I look already all the video for some hours and really dont find where to keep the file!
In the video it's in dicebot.vshost.application and i dont have this file in dicebot ?
Like you can see in the attachement I dont have the same file in the programme like you so I dont know where to keep this file ?
Thanks if you can help me

*

Seuntjie

  • *****
  • 138
  • +0/-1
    • View Profile
Re: loadscript
« Reply #3 on: April 17, 2018, 12:09:04 pm »
The extra files in my folder is because I was running from my debug folder, you don't need those files.

It's looks like you're running the wrong function, you need to use dofile(filename), not loadscript or executefile.

If your filename is sCript70 and it is in the same folder as the exe, then you need to use dofile('sCript70'). If your filename is script70.lua and is in the same folder as the executable, you need to use dofile('script70.lua'). If your script file name is bigbu.tts and is in your pictures folder, you need to use dofile('c:\users\<yourusername>\pictures\bigbu.tts')

*

lilou69

  • **
  • 10
  • +0/-0
    • View Profile
Re: loadscript
« Reply #4 on: April 17, 2018, 02:31:42 pm »
Thanks you so much it's working juste i forgot the .txt before ....

*

lilou69

  • **
  • 10
  • +0/-0
    • View Profile
Re: loadscript
« Reply #5 on: April 17, 2018, 08:40:09 pm »
Sorry seuntjie another question
It's possible or no to do for exemple
dofile('script70')
after 100 win
dofile('script40')
after 200 win
dofile('script80')
....
I think it's not possible but just to be sure ?
Thansk alot

*

Seuntjie

  • *****
  • 138
  • +0/-1
    • View Profile
Re: loadscript
« Reply #6 on: April 18, 2018, 03:05:46 am »
I've heard of people ding this and there's no reason it wouldn't work, you just need to add the logic for when to switch to the dobet function in each of the scripts.

*

lilou69

  • **
  • 10
  • +0/-0
    • View Profile
Re: loadscript
« Reply #7 on: April 18, 2018, 12:26:17 pm »
Thanks you very much seuntjie I finally find how to do it and it work good.
Before 2 week I dont hear about LUA your tutorial and videos help me too much.
Thanks again