Jump to content

Execute quests without changing directory


Recommended Posts

Hi there,

 

I hope this thread finds you all well.
The reason of this thread is mainly the fact I grew tired of having to change the directory and executing a quest with ./qc quest_name.quest every single time, well not every single time, but you know the lines you need to go through while updating quests.

 

Attached to this post you will find a shell script which its sole purpose is to take away that heavy load of you having to type cd /usr/home/share/locale/... && ./qc quest_name.quest every damn time. :D 

All you need to do is copy the file provided in /usr/bin and set file's permissions on 777.

Now before you go bananas there are a few adjustments needed, so follow my lead.


Open the quest file and change the following to reflect the path to your quest folder(i.e: /usr/home/game/share/locale/germany/quest)

#!/bin/sh
get_locale="arkadia" # locale name goes here
get_name="ARKADIA2" # Server name goes here
dean_path="/usr/arkadia2" # do not add a forwards slash (/) at the end of this variable
quest_path="$dean_path/share/locale/$get_locale/quest"

clear
echo -e "\033[1;31m] $get_name Quest menu: "
echo -n "] Type the quest name here to execute it or 'x' to cancel: "
read quest

if [ -z $quest ]
then
	clear
	echo -e "\033[1;31m] Next time, please provide the name of the quest you're trying to execute. \033[0;0m"
elif [ $quest = "x" ] || [ $quest = "q" ]
then
	echo -e "\033[0;0m"
	clear
else
	echo -e "\033[0;31m"
	clear
	quest_name="$quest.quest"
	cd $quest_path
	if [ -f $quest_name ]
	then
		./qc $quest_name
		echo -e "\033[1;31m] $quest_name has been executed successfully. \033[0;0m"
	else
		echo -e "\033[1;31m] $quest_name not found. Please try again. \033[0;0m"
	fi
fi

Save your progress and now start a SSH session and after logging you will call this script by typing quest and it should look something like this:

38f901a5cbd400bdb21603b62c8c18c5.png

Now you can go bananas on this! :lol: 

If you have questions or suggestions in regards of the above, leave a reply to this thread as usual.

Cheers!

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 3
for brain_cells in xrange(brain):
  if brain_cells == 0:
    print("0x3703c7 Fatal error occurred. Please replace the brain.")
    break
  if brain_cells == "damaged":
    print("0x3703c7 Error occurred. Please repair damaged brain_cells")
    break
  
  print("brain_cells are at 100% capacity.")

 

Link to comment
Share on other sites

23 minutes ago, ragem0re said:

So.. where is it? :lol:

I only realized that whilst editing a different topic. :lol:

The file is now attached to the thread.

for brain_cells in xrange(brain):
  if brain_cells == 0:
    print("0x3703c7 Fatal error occurred. Please replace the brain.")
    break
  if brain_cells == "damaged":
    print("0x3703c7 Error occurred. Please repair damaged brain_cells")
    break
  
  print("brain_cells are at 100% capacity.")

 

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.