Forums

Scripting Issues

Can't launch anything I write

Auteur Réponses
phys1ks Mercredi 4 Décembre 2013 à 7:49
phys1ksAnonymous

I've been trying to write a script for a game for awhile now, but I can't get it to launch at all, not even this bit of code will produce ANYTHING

#!/bin/bash

[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"

 
POL_SetupWindow_Init
POL_Debug_Init

 
POL_SetupWindow_message "Hello World!" "My first message"

 
POL_SetupWindow_Close

exit


I feel utterly retarded, I've read the documentation and I should be able to make at least a hello world, right?...
Quentin PÂRIS Mercredi 4 Décembre 2013 à 9:03
Quentin PÂRISAnonymous

How are you running it?
phys1ks Mercredi 4 Décembre 2013 à 20:06
phys1ksAnonymous

How are you running it?

Quote from Tinou


Tools > Run Local Script

I can run a script I copied and pasted from here, but not mine?...
phys1ks Mercredi 4 Décembre 2013 à 21:34
phys1ksAnonymous

I'm sorry, I was REALLY tired last night, let me provide some more information...

POL Version 4.2.1
Linux DIGITALL-Minty 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:35:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

The scripts are in my home directory, chmodded 777, I am the owner of them. Neither script I wrote works, but the one I copied and pasted does. I wrote these in gedit.

I'd really like some kind of....debugger? Where can I see the raw output to see why its failing? It doesn't generate any log file in the POL Debug.
petch Mercredi 4 Décembre 2013 à 21:40
petch

Your script worked for me.
Debugger support cannot work because the $TITLE variable is not set before calling POL_Debug_Init.
Strangely, I get a warning about this when I start the script using playonlinux-bash, but not when using Tools > Run a local script.
phys1ks Mercredi 4 Décembre 2013 à 21:44
phys1ksAnonymous

Your script worked for me.
Debugger support cannot work because the $TITLE variable is not set before calling POL_Debug_Init.
Strangely, I get a warning about this when I start the script using playonlinux-bash, but not when using Tools > Run a local script.

Quote from petch


...Wow, it worked when I copied it from this website, pasted it in gedit, saved it as a new file name and ran it, but it won't work if I open another file with the exact same script in it.

...The hell?

[Edit]

FInal edit- Fixed!

dos2unix on the files. I don't know why they had crlf added, but once I ran that all is good.

Edité par phys1ks

petch Mercredi 4 Décembre 2013 à 21:51
petch

Not encoding, but MS-DOS style line breaks.
They're many ways to convert this, including

flip -u scriptname

tr -d '\r' < scriptname > scriptname-unix

Vous êtes ici: Index > PlayOnLinux > Scripting Issues

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com