Jump to content
  • 0

help Weight Changer Script


Question

Posted (edited)

I did a small script that change the weight of items to 15. But has a infinite loop in script and I dont know whats wrong. Can anyone help me? Thanks and sorry for my bad english.


 




- script Weight15 -1,{
OnInit:
set .@i, 501;
while (.@i<13710){
if (getitemname(.@i)){
setiteminfo .@i,6,150;
}
set .@i, .@i + 1;
}
end;
}


 

 

PS: Server in txt.

Edited by Emistry
codebox

1 answer to this question

Recommended Posts

  • 0
Posted

you can improve it if you have loaded the updated SQL item_db .

.@size = query_sql( "SELECT `nameid` FROM `item_db` ",.@id );
while ( .@i < .@size ) {
	setiteminfo .@id[.@i],6,150;
	.@i++;
}

of course, depend on how large the result returned, you may need to use freeloop to avoid the infinity loop error.

or another trick would be slightly delay the execution of the script using sleep.

 

it would be even simpler if you just edit the weight at the SQL database and export it to text version after that.

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...