Jump to content
  • 0

query dropcardid mvp


Question

Posted

hi, im testing this to check mvp card existence

query_sql "SELECT `DropCardid` FROM `mob_db_re` WHERE `MEXP` != 0 ",.@mvpcard$;
query_sql "SELECT `char_id` FROM `inventory` WHERE `nameid` = '"+.@mvpcard$+"' OR `card0` = '"+.@mvpcard$+"' OR `card1` = '"+.@mvpcard$+"' OR `card2` = '"+.@mvpcard$+"' OR `card3` = '"+.@mvpcard$+"'",.@mcid$;
.@totalmvp = getarraysize(.@mcid$);

mes "Total MvP Cards: ^990000" + .@totalmvp +"^000000";

but the result always 0

what did i miss or wrong? thx

3 answers to this question

Recommended Posts

  • 0
Posted
.@rst = query_sql("SELECT inventory.card0, inventory.card1, inventory.card2, inventory.card3 FROM inventory INNER JOIN mob_db_re ON inventory.card0 = mob_db_re.dropcardid OR inventory.card1 = mob_db_re.dropcardid OR inventory.card2 = mob_db_re.dropcardid OR inventory.card3 = mob_db_re.dropcardid WHERE mob_db_re.mexp != 0 AND mob_db_re.dropcardid != 0", .@card0, .@card1, .@card2, .@card3);

if(.@rst == -1) {
	//query error
	end;
}

mes "Total items with MVP cards :" + .@rst;
// Use .@card0 - .@card4 to do whatever you want

 

  • Upvote 1
  • 0
Posted

Thanks @Secrets

// valor trial: simple query mvp card on gears
// thanks to Secrets
// command: @mvp

-	script	mvpcardcheck	-1,{
OnInIt:
	bindatcmd "mvp",strnpcinfo(0)+"::OnCommand",99;
end;

OnCommand:
	.@rst = query_sql("SELECT inventory.char_id, inventory.nameid, inventory.refine, inventory.card0 FROM inventory INNER JOIN mob_db_re ON inventory.card0 = mob_db_re.dropcardid WHERE mob_db_re.mexp != 0 AND mob_db_re.dropcardid != 0", .@cid, .@itemid, .@refine, .@card0);
			for ( .@i = 0; .@i < .@rst; .@i++ ){
				dispbottom .@i+1+"."+strcharinfo(0,.@cid[.@i])+" has +"+.@refine[.@i]+" "+getitemname(.@itemid[.@i])+" ["+getitemname(.@card0[.@i])+"] ";				
			}
end;
}

maybe someone need

  • Upvote 1

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