The forum

Runes Of Magic

Author Replies
siGGismallz Tuesday 9 June 2009 at 1:04
siGGismallzAnonymous

Thanks to NSLW, used his Sims 3 script as basis

My 1st Script :sunglasses:

#!/bin/bash
# Date: (2009-06-09 16-04)
# Last revision: (2009-06-09 16-04)
# Distribution used to test: Ubuntu 9.04
# Wine version used: 1.1.23 
# Licence: Free
# Author: siGGismallz
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
#FETCHING PROGRAMFILES ENVIRONMENTAL VARIABLE
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}

#PREFIX, TITLE AND MESSAGES
PREFIX="RunesOfMagic"
TITLE="Runes Of Magic"
LNG_DL="PlayOnLinux is downloading"
LNG_SSF="has been installed successfully"
LNG_WARNING="The Interface of the Launcher is corrupted and you can't  type anything there, if you still need to type something in there press go on the left side next to the login screen and wait until you will be redirected to the interface start screen again, after that typing will be working within the interface window"

#DOWNLOADING AND SELECTING INSTALLER IMAGE
cd "$REPERTOIRE/tmp"
wget http://i43.tinypic.com/af7n9s.jpg --output-document=left.jpg
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_presentation "$TITLE" "Runewaker Entertainment Corp." "www.runesofmagic.com" "siGGismallz" "$PREFIX" 
 
#SELECTING PREFIX
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
POL_SetupWindow_prefixcreate 

#DOWNLOADING RUNES OF MAGIC 2.0.1.1821
cd "$REPERTOIRE/tmp"
if [ ! -e $REPERTOIRE/tmp/Runes-of-Magic-2011821.exe ]; then
POL_SetupWindow_download "$LNG_DL Runes Of Magic 2.0.1.1821" "Runes Of Magic 2.0.1.1821" "http://frogster.vo.llnwd.net/o9/Runes-of-Magic-2011821.exe"
fi

#STARTING SETUP
wine "Runes-of-Magic-2011821.exe"
 
#MAKING SHORTCUT
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Runes of Magic/" "Runes of Magic.exe" "" "$TITLE" "" ""

#CLEANING TEMP
clean_tmp

#FINISHING
POL_SetupWindow_message "$TITLE $LNG_SSF" "$TITLE" 
POL_SetupWindow_message "$LNG_WARNING"
POL_SetupWindow_Close
exit

Edited by siGGismallz

NSLW Tuesday 9 June 2009 at 8:14
NSLW

My 1st Script :sunglasses:

Quote from siGGismallz

It's very similar to mine scripts :laught:

So let's start:

1) you musn't use "TYTUL" it could be anything and script will work anyway
2) you don't have to do
elif [ "$POL_LANG" == "pt" ]then
TYTUL="Runes Of Magic"

The title Runes Of Magic in every language is the same (I see The Sims 3 influence :laught:)
3) you should do
cd "$REPERTOIRE/tmp/"
right before #DOWNLOADING RUNES OF MAGIC 2.0.1.1821 and remove it after #UNPACKING WINSOCK.DLL.ZIP
4) You should insert function which creates prefix, because now you only select where the prefix should be created
5) Why do you copy winsock.dll to system directory? Isn't system32 enough?
6)
echo "\\"winsock.dll\\"=\\"native\\"" >> override.reg 
this should be without dll extension


And that's all I see now. You should edit your script and correct it. I hope there will be no objection from other team members :)




siGGismallz Tuesday 9 June 2009 at 12:21
siGGismallzAnonymous

the tutorial script posts here suck i dont understand anything there, so i used sims 3 script as basis because this way it was easier to create a script myself

1) fixed.
2) fixed.
3 fixed???
5) found it in google that way, but works like u suggested too
6) fixed.

4) what do you mean by that?


can $REPERTOIRE also be changed? it stands for the playonlinux folder if i understood it right?

Edited by siGGismallz

NSLW Tuesday 9 June 2009 at 12:50
NSLW

3 fixed???

Quote from siGGismallz

Yes, it's always safely to do "cd to directory" before every "non-POL_SetupWindow_download"

4) what do you mean by that?

Quote from siGGismallz

POL_SetupWindow_prefixcreate
Almost every script should have got that after select_prefix

can $REPERTOIRE also be changed? it stands for the playonlinux folder if i understood it right?

Quote from siGGismallz


REPERTOIRE is "~/.PlayOnLinux" and it cannot be changed

Edited by NSLW

siGGismallz Tuesday 9 June 2009 at 13:02
siGGismallzAnonymous

is it perfect now ? :p

Edited by siGGismallz

NSLW Tuesday 9 June 2009 at 13:12
NSLW

is it perfect now ? :p

Quote from siGGismallz

If there won't be objections from other team members then I could accept your script. Send your script for validation tomorrow ;-)
siGGismallz Tuesday 9 June 2009 at 13:14
siGGismallzAnonymous

how can i do that? o.O
Ghostofkendo Tuesday 9 June 2009 at 15:53
Ghostofkendo

Hi siGGismallz,

Pretty good script for a first one ;-)

the tutorial script posts here suck i dont understand anything there

Quote from siGGismallz
Of what post are you talking about?
If you mean this one, it's normal that you don't understand, this isn't a tutorial but a kind of "quick" reference of all the available functions to help people who already know how to do a script.
The real tutorial to learn how to do a script is available via the "Documentation" link at the top of the website. ;-)

is it perfect now ?:p

Quote from NSLW
If there won't be objections from other team members then I could accept your script. Send your script for validation tomorrow ;-)

Quote from siGGismallz
What I'm going to say isn't really objections, more like suggestions to improve your script :)

1) The comments at the beginning aren't complete enough, it lacks
# Date: (YYYY-MM-DD HH-MM)
# Last revision: (YYYY-MM-DD HH-MM)
# Wine version used: 
# Licence:

2) The prefix directory's name mustn't contain space characters, use instead PREFIX="RunesOfMagic" or PREFIX="ROM"

3) When you display a message, use a variable so it's way easier to translate a script.
Example:
Replace
POL_SetupWindow_download "PlayOnLinux is downloading Runes Of Magic 2.0.1.1821" "Runes Of Magic 2.0.1.1821" "http://frogster.vo.llnwd.net/o9/Runes-of-Magic-2011821.exe"

With
POL_SetupWindow_download "$LNG_DL" "Runes Of Magic 2.0.1.1821" "http://frogster.vo.llnwd.net/o9/Runes-of-Magic-2011821.exe"

And add what follows after declaring the TITLE and PREFIX variable
LNG_DL="PlayOnLinux is downloading Runes Of Magic 2.0.1.1821"

Thus, if you speak another language than English, you just have to do something like that at the beginning of your script:
if [ "$POL_LANG" == "de" ]; then
LNG_DL="Whatever's translation in German"
else
LNG_DL="Whatever"
fi

Finally, to send your script for validation, click on the "Scripts" link in the right menu then click on the "Add a new script" link.

Bye
NSLW Tuesday 9 June 2009 at 16:10
NSLW

the tutorial script posts here suck i dont understand anything there, so i used sims 3 script as basis because this way it was easier to create a script myself

Quote from siGGismallz

Oh.. I haven't spotted that at first. Fell free to take any script as basis for your creations. It's even better because it's more likely you make less mistakes :sunglasses:


3) When you display a message, use a variable so it's way easier to translate a script.

Quote from siGGismallz

If you wish to translate your script to your mother language then it's good way to do this.
siGGismallz Tuesday 9 June 2009 at 16:38
siGGismallzAnonymous

you guys should make something like a script creator program where you just choose what you want (with pictures or discriptions), this would be really helpful to make scripts ;)
NSLW Tuesday 9 June 2009 at 17:04
NSLW

you guys should make something like a script creator

Quote from siGGismallz

There is something like that, but it isn't updated anymore. It doesn't work for me on Fedora 10 but i saw how it works on Ubuntu 8.04.
Ghostofkendo Tuesday 9 June 2009 at 18:49
Ghostofkendo

Good, you made the changes I suggested however, it's not yet perfect.

1) Why did you removed the "Distribution used to test:" line in the comments at the beginning of the script?

2) About languages variables, you used one for the POL_SetupWindow_download command, good but you forgot to do it too for the POL_SetupWindow_message command at the end of your script.

Now, additional suggestions that I previously didn't thought of:

3) The two commands of the following part:
#CLEANING TEMP
cd "$REPERTOIRE/tmp/"
rm -rf * 

Could be replaced by one command:
#CLEANING TEMP
clean_tmp

4)

Known Issues:
- typing at login screen does not work
solution: click on GO, after you return back to the start screen you will be able to type

Quote from siGGismallz
If it happens to everyone or very frequently, you can add a POL_SetupWindow_message command (using a LNG_WHATEVER variable of course ;-)) to tell it once the installation is finished.
siGGismallz Tuesday 9 June 2009 at 20:26
siGGismallzAnonymous

i already sent my script for vaildation =( can i resend it with the changes u suggested?
Ghostofkendo Tuesday 9 June 2009 at 21:07
Ghostofkendo

Yes, of course. :)
Even if it has been said that you can't edit your script once you asked for its validation, it seems that it's still possible.
siGGismallz Tuesday 9 June 2009 at 22:40
siGGismallzAnonymous

if i want to add it again as script the site says that the name is already in use could you deny the validation of the current script that is non-validated ?
Ghostofkendo Tuesday 9 June 2009 at 22:50
Ghostofkendo

Ok, script denied.
You should be able to edit it now, without the need to add it again.
NSLW Tuesday 9 June 2009 at 23:22
NSLW

Script accepted good work :)
there was small issue with
POL_SetupWindow_message "$WARNING"
but i fixed it :sunglasses:
I hope the next script you write will be easier for you :p

Edited by NSLW

siGGismallz Wednesday 10 June 2009 at 14:54
siGGismallzAnonymous

thx NSLW didnt saw it ;-)

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