Skip to content

Duel.GetCounter ​

Signature ​

lua
Duel.GetCounter(int player, int s, int o, int countertype) -> int|nil

Description ​

Returns the total number of countertype counters in player-relative locations s and o.

Parameters ​

  • player int
  • s int
  • o int
  • countertype int

Returns ​

  • int|nil - Counter count, or nil if player is invalid.

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:4879

Guided Examples ​

Learn how to use this function in context:

Used By ​

Generated from the local Scripts/ folder and cards.cdb.

  • Detected in 12 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetCounter.
CardIDScriptDetected Calls
Starving Venemy Dragon93729065Scripts/c93729065.lua1
Dimonno Vaalmonica30432463Scripts/c30432463.lua1
Mythical Beast Master Cerberus53842431Scripts/c53842431.lua1
Enneapolis17621695Scripts/c17621695.lua2
Battle Shogun of the Six Samurai74752631Scripts/c74752631.lua1
Predaplant Moray Nepenthes22011689Scripts/c22011689.lua1
Starving Venemy Lethal Dose Dragon22070401Scripts/c22070401.lua1
Tempest Magician63101919Scripts/c63101919.lua1
Six Strike - Sextuple Barrage90939874Scripts/c90939874.lua1
Snowdust Giant73659078Scripts/c73659078.lua1
Cloudian - Nimbusman20003527Scripts/c20003527.lua1
Cold Enchanter24661486Scripts/c24661486.lua1

Script Examples ​

Starving Venemy Dragon (93729065) ​

Source: Scripts/c93729065.lua

lua
end
function c93729065.atkval(e,c)
	return Duel.GetCounter(0,1,1,0x104f)*-200
end
function c93729065.rdcon(e,tp,eg,ep,ev,re,r,rp)

Dimonno Vaalmonica (30432463) ​

Source: Scripts/c30432463.lua

lua
end
function s.adval(e,c)
	return Duel.GetCounter(e:GetHandlerPlayer(),1,0,0x6a)*-100
end
function s.pzcost(e,tp,eg,ep,ev,re,r,rp,chk)

Mythical Beast Master Cerberus (53842431) ​

Source: Scripts/c53842431.lua

lua
end
function c53842431.incon(e)
	return Duel.GetCounter(e:GetHandlerPlayer(),1,0,0x1)>=4
end
function c53842431.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)