DayZ Lotto

Grindkore

Member
Hey guys,

I made a simple vbs script called DayZ Lotto. The purpose of this script is to randomly change the predefined default load-outs every time it is executed. On my server I have this script executed once every 20 seconds, thus each time a new survivor spawns he or she gets a different load-out to mix things up. I use BEC schedule to kick off this script, however a windows task manager or any other process that can execute a command line can launch this script. I have it setup on my DayZ server, however this script will work remotely from any machine that can connect to your Bliss hive DB.

Here is the download link from github: https://github.com/grindkore/DayZLotto

If this becomes popular, I will enhance the script to add features and make it more admin friendly.
Your feedback is appreciated, enjoy.
 
Cool thanx man i want to try this out but can u put up a step by step how to install for us noobs out there :(
i have BEC going on my server and i dont know how to add the script in :(
 
Instructions are in readme.txt and the script comments itself. If you can't follow that, there is not much I can do explaining any better.
 
my point is how to get the script to start in BEC ? whats the commmand ? do i do it from in game or in the part where we do the server restarts ?
 
Bec can only start .bat scripts so open notepad and have something like this assuming you put the file in the c:\tools\dayzlotto\dayzlotto.bat:
Code:
start cscript C:\tools\DayZLotto\DayZLotto.vbs

Save text file as DayZLotto.bat

In BEC edit schedule.xml file with looping job to trigger the batch script: (example, you may have to modify job ID etc)
Code:
</job>
        <job id="3">
        <time>000020</time> <!-- run every 20 sec -->
        <day>1,2,3,4,5,6,7</day>
        <loop>1</loop>
        <cmd>C:\tools\DayZLotto\DayZLotto.bat</cmd>
        <cmdtype>1</cmdtype>       
    </job>

Really basic stuff...
 
Just an FYI - I have my SQL DB on a different port than the default and I had to add a few things in manually:

On line 18 INSERT: Const DBPort = "####"

On line 70 AFTER Database=" & DBName & " ADD Port=" & DBPort & "
 
Oops - Well, if I run the .bat or the .vbs file manually (double-click) it works perfectly.

However, if I add it to BEC Scheduler it errors. (Script error, no default database host... blah blah) It's like it's not using the correct information in the file at all; which is totally freaking strange because BEC is just running the same damn .bat file I run manually (which works)
 
To get around the issue ^ above ^ I just set up a windows task to run the bat every few minutes; works. (shrug)
 
Oops - Well, if I run the .bat or the .vbs file manually (double-click) it works perfectly.

However, if I add it to BEC Scheduler it errors. (Script error, no default database host... blah blah) It's like it's not using the correct information in the file at all; which is totally freaking strange because BEC is just running the same damn .bat file I run manually (which works)


in BEC you must make a bat to call the lottto, do you do that?
 
Yes; BEC is calling the .bat file but when it runs it errors out with generic information; like it's not even using the edits I made in the dayzlotto.vbs file.

So if I leave BEC running with the task I get a script error window every 20 seconds.

However, if I have windows task manager run the .bat it works fine. It's really, really odd and the only other thought I have is maybe some strange permissioning I might have on the box.
 
Yes; BEC is calling the .bat file but when it runs it errors out with generic information; like it's not even using the edits I made in the dayzlotto.vbs file.

So if I leave BEC running with the task I get a script error window every 20 seconds.

However, if I have windows task manager run the .bat it works fine. It's really, really odd and the only other thought I have is maybe some strange permissioning I might have on the box.

to avoid loosing the PATH variable you need to use full paths and inside the bat use START as someone says before:

Code:
start cscript C:\tools\DayZLotto\DayZLotto.vbs

can you check that?
 
I assume it's fairly easy to add other equipment to the predefined ones you included; like Bandages.
 
Back
Top