import sys
import os
import xbmcaddon
import xbmc
import xbmcgui

__settings__   = xbmcaddon.Addon(id='plugin.program.skygo.launcher')
#__addonname__   = __addon__.getAddonInfo('name')
#__icon__        = __addon__.getAddonInfo('icon')

configpath = os.path.expanduser(r'~\AppData\Roaming\XBMC\addons\plugin.program.skygo.launcher\skygo.cfg')

username = __settings__.getSetting("username")
password = __settings__.getSetting("password")
sleep1 = __settings__.getSetting("sleep 1")
sleep2 = __settings__.getSetting("sleep 2")
mousex = __settings__.getSetting("Mousex")
mousey = __settings__.getSetting("Mousey")
splashy = __settings__.getSetting("splashy")


foo = open(configpath, 'w')
foo.write("%s\n" % (username))
foo.write("%s\n" % (password))
foo.write("%s\n" % (sleep1))
foo.write("%s\n" % (sleep2))
foo.write("%s\n" % (mousex))
foo.write("%s\n" % (mousey))
foo.write("%s" % (splashy))
foo.close()