[RELEASE][PYTHON/LUA][GUI] Bank-System

04/18/2015 15:21 He3o Crysis#16
Wenn man sowas richtig machen möchte, sollte man es per Source machen.
Quests sind dafür eigentlich nicht gedacht und werden für sowas auch nicht mehr benötigt. (Praise the Leak!)

Nettes Release, aber trotzdem nichts besonderes/neues

Regards
04/18/2015 15:23 Mr. 'Avenue™#17
Quote:
Originally Posted by .He3o Crysis View Post
Wenn man sowas richtig machen möchte, sollte man es per Source machen.
Quests sind dafür eigentlich nicht gedacht und werden für sowas auch nicht mehr benötigt. (Praise the Leak!)

Nettes Release, aber trotzdem nichts besonderes/neues

Regards
Jedoch arbeitet nicht jeder mit dem Source, oder will eine neue game benutzen.
04/18/2015 15:50 Undead Corporation#18
Don't work,when i don't have this "
" in costinfo the GUI appears,when i put this "
" in costinfo the GUI don't appears
04/18/2015 15:52 Mr. 'Avenue™#19
Quote:
Originally Posted by Undead Corporation View Post
Don't work,when i don't have this "
" in costinfo the GUI appears,when i put this "
" in costinfo the GUI don't appears
I don't know what you mean exactly.
For support you can add me in skype: mravenue.epvp
04/18/2015 16:00 Undead Corporation#20
enter to skype to talk
edit: problem resolved

another problem:
SYSERR: Apr 18 17:08:19 :: RunState: LUA_ERROR: [string "ave_bank"]:133: attempt to compare number with nil
SYSERR: Apr 18 17:08:19 :: WriteRunningStateToSyserr: LUA_ERROR: quest ave_bank.start click


i edit the quest :
04/18/2015 21:08 Mr. 'Avenue™#21
Quote:
Originally Posted by Undead Corporation View Post
enter to skype to talk
edit: problem resolved

another problem:
SYSERR: Apr 18 17:08:19 :: RunState: LUA_ERROR: [string "ave_bank"]:133: attempt to compare number with nil
SYSERR: Apr 18 17:08:19 :: WriteRunningStateToSyserr: LUA_ERROR: quest ave_bank.start click


i edit the quest :
PHP Code:
define buyprice 1000000
define maxyang 1999999999
define maxbank 2000000000

quest ave_bank begin
    state start begin
        
function checkUser(name)
            return 
mysql_query(string.format("SELECT count(username) FROM quest.bank WHERE username = '%s'"name))[1][1] > 0
        end
        
function getInfo(namewhat)
            return 
tostring(mysql_query(string.format("SELECT %s FROM quest.bank WHERE username='%s';"whatname))[1][1])
        
end
        
function split_(string_,delimiter)
            
local result = { }
            
local from  1
            local delim_from
delim_to string.findstring_delimiterfrom  )
            while 
delim_from do
                
table.insertresultstring.substring_from delim_from-) )
                
from  delim_to 1
                delim_from
delim_to string.findstring_delimiterfrom  )
            
end
            table
.insertresultstring.substring_from  ) )
            return 
result
        end
        
function client_command(command_)
            return 
ave_bank.split_(command_,"#")
        
end
        
function getinput(par)
            
cmdchat("getinputbegin")
            
local ret input(cmdchat(par))
            
cmdchat("getinputend")
            return 
ret
        end
        when login begin
            cmdchat
("BANK QID/"..q.getcurrentquestindex())
        
end
        when button begin
            local cmd 
ave_bank.client_command(ave_bank.getinput("BANK QUESTCMD"))
            if 
cmd[1] == "MAKELOGIN" then
                
if not ave_bank.checkUser(cmd[2]) then
                    syschat
("Dieser Benutzer existiert nicht!")
                    return
                
end
                
if cmd[3] != ave_bank.getInfo(cmd[2], "password"then
                    syschat
("Dein eingegebens Passworrt ist falsch.")
                    return
                
end
                syschat
("Erfolgreich angemeldet.")
                
cmdchat(string.format("BANK USERDATA/%s/%s/%s"cmd[2], cmd[3], ave_bank.getInfo(cmd[2], "money")))
                
cmdchat("BANK OPEN")
            
end
            
if cmd[1] == "CHANGEPW" then
                
if not ave_bank.checkUser(cmd[2]) then
                    syschat
("Oops! Something went wrong.")
                    return
                
end
                
if cmd[3] != ave_bank.getInfo(cmd[2], "password"then
                    syschat
("Dein altes Passwort ist inkorrekt.")
                    return
                
end
                
if string.len(cmd[4]) < 4 then
                    syschat
("Dein neues Passwort muss mindestens 4 Zeichen haben!")
                    return
                
end
                
if cmd[3] == cmd[4then
                    syschat
("Dein neues Passwort darf nicht dasselbe wie dein jetziges sein!")
                    return
                
end
                mysql_query
(string.format("UPDATE quest.bank set password = '%s' WHERE username = '%s';"cmd[4], cmd[2])) 
                
mysql_query(string.format("INSERT INTO quest.bank_password_log (account_id, name, old_password, new_password, time) VALUES('%d', '%s', '%s', '%s', CURRENT_TIMESTAMP);"pc.get_account_id(), pc.get_name(), cmd[3], cmd[4]))
                
syschat(string.format("Dein Passwort wurde erfolgreich in %s geändert!"cmd[4]))
            
end
            
if cmd[1] == "CASHIN" then
                local cashedin 
tonumber(cmd[4])
                
local saldo tonumber(ave_bank.getInfo(cmd[2], "money"))
                if 
not ave_bank.checkUser(cmd[2]) then
                    syschat
("Oops! Something went wrong.")
                    return
                
end
                
if cmd[3] != ave_bank.getInfo(cmd[2], "password"then
                    syschat
("Oops! Something went wrong.")
                    return
                
end
                
if cashedin <= 0 then
                    syschat
("Was versuchst du da?")
                    return
                
end
                
if cashedin pc.get_gold() then
                    syschat
("Soviel Yang besitzt du nicht!")
                    return
                
end
                
if cashedin+saldo maxbank then
                    syschat
("Soviel Yang kannst du nicht einzahlen!")
                    return
                
end
                mysql_query
(string.format("INSERT INTO quest.bank_deposit_log (account_id, name, money, bank_name, time) VALUES('%d', '%s', '%s', '%s', CURRENT_TIMESTAMP);"pc.get_account_id(), pc.get_name(), cashedincmd[2]))
                
mysql_query(string.format("UPDATE quest.bank SET money = money + '%s' WHERE username = '%s';"cashedincmd[2]))
                
pc.changegold(-cashedin)
                
syschat(string.format("Du hast %s Yang eingezahlt."cashedin))
                
cmdchat(string.format("BANK USERDATA/%s/%s/%s"cmd[2], cmd[3], ave_bank.getInfo(cmd[2], "money")))
            
end
            
if cmd[1] == "CASHOUT" then
                local cashedout 
tonumber(cmd[4])
                
local saldo tonumber(ave_bank.getInfo(cmd[2], "money"))
                if 
not ave_bank.checkUser(cmd[2]) then
                    syschat
("Oops! Something went wrong.")
                    return
                
end
                
if cmd[3] != ave_bank.getInfo(cmd[2], "password"then
                    syschat
("Oops! Something went wrong.")
                    return
                
end
                
if cashedout <= 0 then
                    syschat
("Was versuchst du da?")
                    return
                
end
                
if cashedout >= saldo then
                    syschat
("Soviel Yang hast du nicht auf deinem Konto!")
                    return
                
end
                
if cashedout+pc.get_gold() > maxyang then
                    syschat
(string.format("Du darfst maximal nur %d Yang mit dir rumtragen."maxyang))
                    return
                
end
                mysql_query
(string.format("INSERT INTO quest.bank_withdraw_funds_log (account_id, name, money, bank_name, time) VALUES('%d', '%s', '%s', '%s', CURRENT_TIMESTAMP);"pc.get_account_id(), pc.get_name(), cashedoutcmd[2]))
                
mysql_query(string.format("UPDATE quest.bank SET money = money - '%s' WHERE username = '%s';"cashedoutcmd[2]))
                
pc.changegold(cashedout)
                
syschat(string.format("Du hast %s Yang ausgezahlt."cashedout))
                
cmdchat(string.format("BANK USERDATA/%s/%s/%s"cmd[2], cmd[3], ave_bank.getInfo(cmd[2], "money")))
            
end
            
if cmd[1] == "TRANSFER" then
                local amount 
tonumber(cmd[4])
                
local saldo tonumber(ave_bank.getInfo(cmd[2], "money"))
                
local targetsaldo tonumber(ave_bank.getInfo(cmd[5], "money"))
                if 
not ave_bank.checkUser(cmd[2]) then
                    syschat
("Oops! Something went wrong.")
                    return
                
end
                
if cmd[3] != ave_bank.getInfo(cmd[2], "password"then
                    syschat
("Oops! Something went wrong.")
                    return
                
end
                
if cmd[2] == cmd[5then
                    syschat
("Was versuchst du da?")
                    return
                
end
                
if amount <= 0 then
                    syschat
("Was versuchst du da?")
                    return
                
end
                
if not ave_bank.checkUser(cmd[5]) then
                    syschat
("Dieses Bankkonto existiert nicht!")
                    return
                
end
                
if amount >= saldo then
                    syschat
("Soviel Yang hast du nicht auf deinem Konto!")
                    return
                
end
                
if amount+targetsaldo maxbank then
                    syschat
("Soviel Yang kann das Bankkonto nicht aufnehmen!")
                    return
                
end
                mysql_query
(string.format("INSERT into quest.bank_transfer_log (account_id, name, value, transfer_to, time) VALUES('%d', '%s', '%s', '%s', CURRENT_TIMESTAMP);"pc.get_account_id(), pc.get_name(), amountcmd[5]))
                
mysql_query(string.format("UPDATE quest.bank SET money = money - '%s' WHERE username = '%s';"amountcmd[2]))
                
mysql_query(string.format("UPDATE quest.bank SET money = money + '%s' WHERE username = '%s';"amountcmd[5]))
                
syschat(string.format("Du hast %s an %s überwiesen."amountcmd[5]))
                
cmdchat(string.format("BANK USERDATA/%s/%s/%s"cmd[2], cmd[3], ave_bank.getInfo(cmd[2], "money")))
            
end
            
if cmd[1] == "REGISTER" then
                
if pc.get_gold() < buyprice then
                    syschat
(string.format("Du hast nicht genügend Yang. Dir fehlt %d Yang!"tonumber(buyprice-pc.get_gold())))
                    return
                
end
                
if ave_bank.checkUser(cmd[2]) then
                    syschat
("Ein Bankkonto mit dem Namen existiert bereits.")
                    return
                
end
                
if string.len(cmd[2]) < or string.len(cmd[3]) > 12 then
                    syschat
("Dein Benutzername muss mindestens 4 & darf maximal 12 Zeichen haben!")
                    return
                
end
                
if string.len(cmd[3]) < or string.len(cmd[3]) > 12 then
                    syschat
("Dein Passwort muss mindestens 4 & darf maximal 12 Zeichen haben!")
                    return
                
end
                mysql_query
(string.format("INSERT INTO quest.bank (account_id, name, username, password, time) VALUES ('%d', '%s', '%s', '%s', CURRENT_TIMESTAMP);"pc.get_account_id(), pc.get_name(), cmd[2], cmd[3]))
                
pc.change_gold(-buyprice)
                
syschat(string.format("Benutzername: %s"cmd[2]))
                
syschat(string.format("Passwort: %s"cmd[3]))
            
end
        end
    end
end 
Try it.
04/18/2015 23:27 Undead Corporation#22
define buyprice 1000000
define maxyang 1999999999
define maxbank 2000000000
where put this?
04/19/2015 01:04 Mr. 'Avenue™#23
Quote:
Originally Posted by Undead Corporation View Post
define buyprice 1000000
define maxyang 1999999999
define maxbank 2000000000
where put this?
It have to be in the quest-file.
But you can delete the variables if you change the uses of this variables with their values.
04/19/2015 08:33 Undead Corporation#24
don't work
04/26/2015 02:50 Zphr#25
0426 03:06:42039 :: Traceback (most recent call last):

0426 03:06:42040 :: File "ui.py", line 99, in OnMouseLeftButtonDown

0426 03:06:42040 :: AttributeError
0426 03:06:42040 :: :
0426 03:06:42040 :: 'ExpandedImageBox' object has no attribute 'clickEvent'
0426 03:06:42040 ::
05/27/2015 19:40 Damianowski0101#26
how to add this ? 0_o i have problem with german lang help ; (
[Only registered and activated users can see links. Click Here To Register...]

use client 40k
sysrr

0527 19:27:26721 :: Traceback (most recent call last):

0527 19:27:26721 :: File "networkModule.py", line 245, in SetGamePhase

0527 19:27:26722 :: File "system.py", line 130, in __pack_import

0527 19:27:26722 :: File "
0527 19:27:26722 :: game.py
0527 19:27:26722 :: ", line
0527 19:27:26722 :: 2279
0527 19:27:26722 ::

0527 19:27:26722 ::
0527 19:27:26722 :: constInfo.INPUT_IGNORE = 1

0527 19:27:26722 ::
0527 19:27:26722 ::
0527 19:27:26722 ::
0527 19:27:26722 ::
0527 19:27:26722 ::
0527 19:27:26722 ::
0527 19:27:26722 ::
0527 19:27:26722 ::
0527 19:27:26722 ::
0527 19:27:26722 :: ^

0527 19:27:26722 :: IndentationError
0527 19:27:26722 :: :
0527 19:27:26722 :: expected an indented block
0527 19:27:26722 ::



and quest error

ave_bank.quest:1:must start with 'quest'
Abort trap (core dumped)
05/28/2015 03:01 worldend#27
SYSERR: May 28 00:52:46 :: RunState: LUA_ERROR: [string "ave_bank"]:133: attempt to compare number with nil
SYSERR: May 28 00:52:46 :: WriteRunningStateToSyserr: LUA_ERROR: quest ave_bank.start letter
SYSERR: May 28 00:52:55 :: RunState: LUA_ERROR: locale/germany/quest/object/state/ave_bank:2: attempt to index field `?' (a nil value)

SYSERR: May 28 00:55:44 :: WriteRunningStateToSyserr: LUA_ERROR: quest ave_bank.start letter
SYSERR: May 28 00:56:35 :: RunState: LUA_ERROR: [string "ave_bank"]:133: attempt to compare number with nil

I can't register normaly in this gui, just by db I registered account & i can login... Pff
I can't take or pay any value money in account ... Pff
This is crap & good luck with this shit :/
05/28/2015 13:49 *Nicki*#28
einfach super danke
05/28/2015 19:33 freddyryks#29
good :D
05/29/2015 01:26 Noa_#30
sehr bescheiden, bis auf die quest :D

ich hätte das gui, i-wo eingebaut, nicht separat.

trotzdem gut gemacht