Jump to content
  • 0

query dropcardid mvp


Valor

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   28
  • Joined:  12/21/16
  • Last Seen:  

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

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   3
  • Joined:  10/11/13
  • Last Seen:  

try to join 2 table sir :)

Edited by wonderman
nvm
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   28
  • Joined:  12/21/16
  • Last Seen:  

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