sader1992 Posted September 24, 2015 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: Yesterday at 01:31 PM Share 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 Link to comment Share on other sites More sharing options...
sader1992 Posted September 26, 2015 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: Yesterday at 01:31 PM Author Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted September 27, 2015 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
sader1992 Posted September 27, 2015 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: Yesterday at 01:31 PM Author Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted September 27, 2015 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
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 sader1992Link to comment
Share on other sites
4 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.