sader1992 Posted September 24, 2015 Posted September 24, 2015 (edited) hello i want to make script copy from table to table OnTimer10000: copy the account_id + str + value from global_reg_value and delete them and make chg in acc_reg_num edit on the account_id str = key value = {value(global_reg_value)+value(acc_reg_num)} or set (global_reg_value)account_id = playeracc set (global_reg_value)value = pointsupdate atcommand"#CASHPOINTS "+playeracc" "+pointsupdate; and delete the line in the table or set value(global_reg_value) = 0 Is this possible? Edited September 24, 2015 by sader1992 Quote
sader1992 Posted September 26, 2015 Author Posted September 26, 2015 like this - script update points -,{ OnPCLoginEvent: query_sql( "SELECT `account_id`,`value` FROM `global_reg_value` ",.@iduser,.@valueuser ); .idus = .@iduser; .valueus = .@valueuser; query_sql("UPDATE `acc_reg_num` SET account_id = '"+.idus+"', key = #CASHPOINTS, value = (value + '"+.valueus+"')"); query_sql("UPDATE `global_reg_value` SET account_id = 0, key = 0, value = 0"); end; } but there is error~ anyone? Quote
Capuche Posted September 27, 2015 Posted September 27, 2015 Hmm maybe - script update points -1,{ OnPCLoginEvent: query_sql "INSERT INTO `acc_reg_num` (`account_id`, `key`, `index`, `value`) select account_id, '#CASHPOINTS', 0, `value` from `global_reg_value` where `account_id` "+ "= '"+ getcharid(3) +"' on duplicate key update `acc_reg_num`.`value` = `acc_reg_num`.`value` + `global_reg_value`.`value`"; query_sql "delete from `global_reg_value` where account_id = "+ getcharid(3) +" and `str` = '#CASHPOINTS'"; end; } 1 Quote
sader1992 Posted September 27, 2015 Author Posted September 27, 2015 Hmm maybe - script update points -1,{ OnPCLoginEvent: query_sql "INSERT INTO `acc_reg_num` (`account_id`, `key`, `index`, `value`) select account_id, '#CASHPOINTS', 0, `value` from `global_reg_value` where `account_id` "+ "= '"+ getcharid(3) +"' on duplicate key update `acc_reg_num`.`value` = `acc_reg_num`.`value` + `global_reg_value`.`value`"; query_sql "delete from `global_reg_value` where account_id = "+ getcharid(3) +" and `str` = '#CASHPOINTS'"; end; } Thank you it's work Perfect Solved Quote
Capuche Posted September 27, 2015 Posted September 27, 2015 Note it should be better to run the sql offline in one go (you save memory) INSERT INTO `acc_reg_num` (`account_id`, `key`, `index`, `value`) select account_id, '#CASHPOINTS', 0, `value` from `global_reg_value` on duplicate key update `acc_reg_num`.`value` = `acc_reg_num`.`value` + `global_reg_value`.`value` delete from `global_reg_value` where `str` = '#CASHPOINTS' 1 Quote
Question
sader1992
hello
i want to make script copy from table to table
OnTimer10000:
copy the account_id + str + value
from global_reg_value
and delete them
and make chg in acc_reg_num
edit on the account_id
str = key
value = {value(global_reg_value)+value(acc_reg_num)}
or
set (global_reg_value)account_id = playeracc
set (global_reg_value)value = pointsupdate
atcommand"#CASHPOINTS "+playeracc" "+pointsupdate;
and delete the line in the table or set value(global_reg_value) = 0
Is this possible?
Edited by sader19924 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.