Jump to content
  • 0

Database Merging Infinite Loop Problem HELP


Question

Posted (edited)
-	script	commands	-1,{
OnInit:
	set .limit,127;
	bindatcmd "update","commands::OnDoUPDATE",99,99;

	end;

OnDoUPDATE:
set .accid,2006800;
set .charid,162000;

for( set .@k, 0; .@k < .limit; set .@k, .@k + 1 ){
query_sql( "select account_id from `login` order by account_id asc limit 127", .@accid);
	for( set .@i, 0; .@i < getarraysize(.@accid); set .@i, .@i + 1 ){

		query_sql "UPDATE `char` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@i]+"'";
		query_sql "UPDATE `login` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@i]+"'";
		query_sql "UPDATE `global_reg_value` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@i]+"'";
		query_sql "UPDATE `guild_member` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@i]+"'";
		query_sql "UPDATE `pet` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@i]+"'";
		query_sql "UPDATE `sc_data` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@i]+"'";
		query_sql "UPDATE `storage` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@i]+"'";
		query_sql "UPDATE `vendings` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@i]+"'";
		
		set .accid,.accid+1;
	}
}
for( set .@k, 0; .@k < .limit; set .@k, .@k + 1 ){
query_sql( "select char_id from `char` order by char_id asc limit 127", .@charid);

	for( set .@i, 0; .@i < getarraysize(.@charid); set .@i, .@i + 1 ){

		query_sql "UPDATE `cart_inventory` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `char` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `global_reg_value` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `homunculus` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `inventory` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `pet` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `quest` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `sc_data` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `skill` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";

		set .charid,.charid+1;
	}
}
end;
}

I made a script where I can update ng char id, account id before merging the database. But I have problem. There is an infinite loop problem. I tried increasing the max getarraysize but there is an error. Please help me asap will to donate 3$ - 5$ if it works.

post-21795-0-38295700-1431095420_thumb.png

Edited by gmprestige

2 answers to this question

Recommended Posts

Posted

There's a problem I encountered. login and char it not same. 

So I made a new script please check it.

 

-	script	commands	-1,{
OnInit:
	set .limit,127;
	bindatcmd "update","commands::OnDoUPDATE",99,99;

	end;

OnDoUPDATE:
set .accid,2006800;
set .charid,162000;
freeloop(1);
query_sql( "select account_id from `login` order by account_id asc", .@accid);
query_sql( "select char_id from `char` order by char_id asc", .@charid);

	for( set .@p, 0; .@p < getarraysize(.@accid); set .@p, .@p + 1 ){

		query_sql "UPDATE `char` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@p]+"'";
		query_sql "UPDATE `login` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@p]+"'";
		query_sql "UPDATE `global_reg_value` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@p]+"'";
		query_sql "UPDATE `guild_member` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@p]+"'";
		query_sql "UPDATE `pet` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@p]+"'";
		query_sql "UPDATE `sc_data` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@p]+"'";
		query_sql "UPDATE `storage` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@p]+"'";
		query_sql "UPDATE `vendings` SET `account_id` = '"+.accid+"' WHERE `account_id` = '"+.@accid[.@p]+"'";
		
		set .accid,.accid+1;
	}




	for( set .@i, 0; .@i < getarraysize(.@charid); set .@i, .@i + 1 ){

		query_sql "UPDATE `cart_inventory` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `char` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `global_reg_value` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `homunculus` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `inventory` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `pet` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `quest` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `sc_data` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";
		query_sql "UPDATE `skill` SET `char_id` = '"+.charid+"' WHERE `char_id` = '"+.@charid[.@i]+"'";

		set .charid,.charid+1;
	}


freeloop(0);
end;
}

Freeloop is not working. How can I freeloop it?

post-21795-0-11608700-1431100276_thumb.png
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...