Jump to content
  • 0

help Weight Changer Script


spuri

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Reputation:   0
  • Joined:  12/05/15
  • Last Seen:  

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
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2370
  • Joined:  10/28/11
  • Last Seen:  

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.

Link to comment
Share on other sites

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.

×
×
  • Create New...