YGOPRO Forum

Welcome Guest! To enable all features please try to register or login.
2 Pages12>
Options
Go to last post Go to first unread
BananaPhone42  
#1 Posted : Wednesday, January 24, 2018 7:20:35 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Before we start, if you think I'm making the game easier, then feel free to think that. I did it on a mere whim.

I dunno if anyone's ever done this before, but I've made it so where you gain the benefits of the "ai-cheating.lua" Here's a file in case you're wanting to try it out for yourself. With this AI, you:

+Gain 500 LP during your Draw Phase and draw 1 extra card.
+Can Normal Summon up to 5 times.
+Cannot lose the Duel if your LP reaches 0 (however, you can lose due to card effects such as Duel Winners like Exodia.)

New Features (Optional additions):
+Cannot lose the Duel by Decking Out nor effect
+Can have more than 10 cards in your Hand.
+Your monsters can have a permanent 500 ATK/DEF boost (This can be modified to whatever you like).
+Monsters in your hand can either have their Level raised or lowered, making it easier/harder to summon them.
+Monsters on your side of the field can count as two tributes.
+Monsters in the Monster Zone cannot be destroyed by battle and/or effect.
+Your opponent's hand is always face-up.
+You need one less tribute for Higher-Level Monsters.
+Any of your Monsters can declare an Attack in Defense Position.
+Battle Damage your opponent inflicts on you is bounced back.
+You only need to pay 1 Life Point in order to activate anything at all.
+Your opponent cannot use Monster Effects (Change to LOCATION_SZONE so the opponent cannot use Spells/Traps, or LOCATION_ONFIELD so that your opponent cannot use either of them).
+Assuming your Monsters were to be destroyed by Battle only, they return to your Hand.
+Activate Trap Cards in your Hand.
+Your monsters cannot be targeted as either Battle or Effect targets.
+Instead of taking damage, you absorb any direct damage you take.
+Inflict Piercing damage to your opponent, no matter what.
+Never take any Battle Damage and/or Effect Damage*.
+Attack Directly at will.
+Your opponent's effects will not Trigger anywhere.

* - e26 and e27 must be used together for it to work.

If you'd rather not download it, you can copy and paste it onto the "ai-cheating.lua" down below.

Code:
-- A cheating AI file, which draws additional cards and recovers LP each turn


-- Configure these to your liking

require("ai.ai")

EXTRA_SUMMON = 5
EXTRA_DRAW = 1
LP_RECOVER = 500

GlobalCheating = true

math.randomseed( require("os").time() )
function EnableCheats()
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_PHASE+PHASE_DRAW)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-player_ai
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
--AI.Chat("Oh yeah, cheating feels good.")
Duel.Draw(1-player_ai,EXTRA_DRAW,REASON_RULE)
Duel.Recover(1-player_ai,LP_RECOVER,REASON_RULE)
end)
Duel.RegisterEffect(e1,player_ai)
local e2=Effect.GlobalEffect()
    e2:SetType(EFFECT_TYPE_FIELD)
    e2:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
    e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
    e2:SetTargetRange(1,0)
    e2:SetValue(EXTRA_SUMMON)
    Duel.RegisterEffect(e2,1-player_ai)
local e3=Effect.GlobalEffect()
e3:SetType(EFFECT_TYPE_FIELD)
    e3:SetCode(EFFECT_CANNOT_LOSE_LP)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetValue(1)
Duel.RegisterEffect(e3,1-player_ai)
end


New Features (Optional):
Code:
local e4=Effect.GlobalEffect()
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_LOSE_DECK)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetValue(1)
Duel.RegisterEffect(e4,1-player_ai)

local e5=Effect.GlobalEffect()
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_LOSE_EFFECT)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,0)
e5:SetValue(1)
Duel.RegisterEffect(e5,1-player_ai)

local e6=Effect.GlobalEffect()
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_HAND_LIMIT)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,0)
e6:SetValue(10)
Duel.RegisterEffect(e6,1-player_ai)

local e7=Effect.GlobalEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_UPDATE_ATTACK)
e7:SetRange(LOCATION_FZONE)
e7:SetTargetRange(LOCATION_MZONE,0)
e7:SetValue(500)
Duel.RegisterEffect(e7,1-player_ai)

local e8=Effect.GlobalEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EFFECT_UPDATE_DEFENSE)
e8:SetRange(LOCATION_FZONE)
e8:SetTargetRange(LOCATION_MZONE,0)
e8:SetValue(500)
Duel.RegisterEffect(e8,1-player_ai)

local e9=Effect.GlobalEffect(c)
e9:SetType(EFFECT_TYPE_FIELD)
e9:SetCode(EFFECT_UPDATE_LEVEL)
e9:SetRange(LOCATION_FZONE)
e9:SetTargetRange(LOCATION_HAND,0)
e9:SetValue(0)
Duel.RegisterEffect(e9,1-player_ai)

local e10=Effect.GlobalEffect(c)
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_DOUBLE_TRIBUTE)
e10:SetRange(LOCATION_FZONE)
e10:SetTargetRange(LOCATION_MZONE,0)
e10:SetValue(1)
Duel.RegisterEffect(e10,1-player_ai)

local e11=Effect.GlobalEffect(c)
e11:SetType(EFFECT_TYPE_FIELD)
e11:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e11:SetRange(LOCATION_FZONE)
e11:SetTargetRange(LOCATION_MZONE,0)
e11:SetValue(1)
Duel.RegisterEffect(e11,1-player_ai)

local e12=Effect.GlobalEffect(c)
e12:SetType(EFFECT_TYPE_FIELD)
e12:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e12:SetRange(LOCATION_FZONE)
e12:SetTargetRange(LOCATION_MZONE,0)
e12:SetValue(1)
Duel.RegisterEffect(e12,1-player_ai)

local e13=Effect.GlobalEffect(c)
e13:SetType(EFFECT_TYPE_FIELD)
e13:SetCode(EFFECT_PUBLIC)
e13:SetRange(LOCATION_FZONE)
e13:SetTargetRange(0,LOCATION_HAND)
e13:SetValue(1)
Duel.RegisterEffect(e13,1-player_ai)

local e14=Effect.GlobalEffect(c)
e14:SetType(EFFECT_TYPE_FIELD)
e14:SetCode(EFFECT_DECREASE_TRIBUTE)
e14:SetRange(LOCATION_FZONE)
e14:SetTargetRange(0x6,0)
e14:SetValue(1)
Duel.RegisterEffect(e14,1-player_ai)

local e15=Effect.GlobalEffect(c)
e15:SetType(EFFECT_TYPE_FIELD)
e15:SetCode(EFFECT_DEFENSE_ATTACK)
e15:SetRange(LOCATION_FZONE)
e15:SetTargetRange(LOCATION_MZONE,0)
e15:SetValue(1)
Duel.RegisterEffect(e15,1-player_ai)

local e16=Effect.GlobalEffect()
e16:SetType(EFFECT_TYPE_FIELD)
e16:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e16:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e16:SetTargetRange(1,0)
e16:SetValue(1)
Duel.RegisterEffect(e16,1-player_ai)

local e17=Effect.GlobalEffect(c)
e17:SetType(EFFECT_TYPE_FIELD)
e17:SetCode(EFFECT_LPCOST_CHANGE)
e17:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e17:SetRange(LOCATION_FZONE)
e17:SetTargetRange(1,0)
e17:SetValue(1)
Duel.RegisterEffect(e17,1-player_ai)

local e18=Effect.GlobalEffect(c)
e18:SetType(EFFECT_TYPE_FIELD)
e18:SetCode(EFFECT_DISABLE)
e18:SetRange(LOCATION_FZONE)
e18:SetTargetRange(0,LOCATION_MZONE)
e18:SetValue(1)
Duel.RegisterEffect(e18,1-player_ai)

local e19=Effect.GlobalEffect(c)
e19:SetType(EFFECT_TYPE_FIELD)
e19:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e19:SetRange(LOCATION_FZONE)
e19:SetTargetRange(LOCATION_MZONE,0)
e19:SetValue(LOCATION_HAND)
Duel.RegisterEffect(e19,1-player_ai)

local e20=Effect.GlobalEffect(c)
e20:SetType(EFFECT_TYPE_FIELD)
e20:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e20:SetRange(LOCATION_FZONE)
e20:SetTargetRange(LOCATION_HAND,0)
e20:SetValue(1)
Duel.RegisterEffect(e20,1-player_ai)

local e21=Effect.GlobalEffect(c)
e21:SetType(EFFECT_TYPE_FIELD)
e21:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e21:SetRange(LOCATION_FZONE)
e21:SetTargetRange(LOCATION_MZONE,0)
e21:SetValue(1)
Duel.RegisterEffect(e21,1-player_ai)

local e22=Effect.GlobalEffect(c)
e22:SetType(EFFECT_TYPE_FIELD)
e22:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e22:SetRange(LOCATION_FZONE)
e22:SetTargetRange(LOCATION_MZONE,0)
e22:SetValue(1)
Duel.RegisterEffect(e22,1-player_ai)

local e23=Effect.GlobalEffect()
e23:SetType(EFFECT_TYPE_FIELD)
e23:SetCode(EFFECT_REVERSE_DAMAGE)
e23:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e23:SetTargetRange(1,0)
e23:SetValue(1)
Duel.RegisterEffect(e23,1-player_ai)

local e24=Effect.GlobalEffect()
e24:SetType(EFFECT_TYPE_FIELD)
e24:SetCode(EFFECT_PIERCE)
e24:SetRange(LOCATION_FZONE)
e24:SetTargetRange(LOCATION_MZONE,0)
e24:SetValue(1)
Duel.RegisterEffect(e24,1-player_ai)

local e25=Effect.GlobalEffect()
e25:SetType(EFFECT_TYPE_FIELD)
e25:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e25:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e25:SetTargetRange(1,0)
e25:SetValue(1)
Duel.RegisterEffect(e25,1-player_ai)

local e26=Effect.GlobalEffect()
e26:SetType(EFFECT_TYPE_FIELD)
e26:SetCode(EFFECT_CHANGE_DAMAGE)
e26:SetRange(LOCATION_FZONE)
e26:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e26:SetTargetRange(1,0)
e26:SetValue(0)
Duel.RegisterEffect(e26,1-player_ai)
local e27=e26:clone()
e27:SetCode(EFFECT_NO_EFFECT_DAMAGE)
Duel.RegisterEffect(e27,1-player-ai)

local e28=Effect.GlobalEffect(c)
e28:SetType(EFFECT_TYPE_FIELD)
e28:SetCode(EFFECT_DIRECT_ATTACK)
e28:SetRange(LOCATION_FZONE)
e28:SetTargetRange(LOCATION_ONFIELD,0)
e28:SetValue(1)
Duel.RegisterEffect(e28,1-player_ai)

local e29=Effect.GlobalEffect(c)
e29:SetType(EFFECT_TYPE_FIELD)
e29:SetCode(EFFECT_CANNOT_TRIGGER)
e29:SetRange(LOCATION_FZONE)
e29:SetTargetRange(0,0xFF)
e29:SetValue(1)
Duel.RegisterEffect(e29,1-player_ai)
end

Edited by user Tuesday, June 26, 2018 3:05:36 PM(UTC)  | Reason: Opponent's effects cannot Trigger added.

File Attachment(s):
ai-cheatingplayer.lua (2kb) downloaded 6 time(s).

You cannot view/download attachments. Try to login or register.
salvadorc17  
#2 Posted : Thursday, January 25, 2018 8:41:01 PM(UTC)
salvadorc17

Rank: Advanced Member

Joined: 2/27/2013(UTC)
Posts: 537

Thanks: 6 times
Was thanked: 164 time(s) in 98 post(s)
Why you want to make things easier, it would be better to make Cheating AI be more difficult.
BananaPhone42  
#3 Posted : Thursday, January 25, 2018 11:53:56 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: salvadorc17 Go to Quoted Post
Why you want to make things easier, it would be better to make Cheating AI be more difficult.


While you have a point there, this is honestly just a "for fun" thing; I just did it 'cause I could. I mean, you don't have to use it, y'know? 'Sides, if there can be a "Cheating AI", why not give the player that ability?

Edited by user Thursday, January 25, 2018 11:57:11 PM(UTC)  | Reason: Not specified

Hippocampus1901  
#4 Posted : Friday, January 26, 2018 5:48:27 PM(UTC)
Hippocampus1901

Rank: Advanced Member

Joined: 12/29/2015(UTC)
Posts: 162

Thanks: 10 times
Was thanked: 36 time(s) in 36 post(s)
Hi BananaPhone42,

What do you mean by "Special Summon Monsters 5 times"? You already can special summon monsters as many times as you like per turn. If you want to cap this amount, have you tried looking at the scripts of cards like Summon Limit or Scary Moth?
BananaPhone42  
#5 Posted : Friday, January 26, 2018 7:41:25 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Hippocampus1901 Go to Quoted Post
Hi BananaPhone42,

What do you mean by "Special Summon Monsters 5 times"? You already can special summon monsters as many times as you like per turn. If you want to cap this amount, have you tried looking at the scripts of cards like Summon Limit or Scary Moth?


Sorry if I'm too vague for you. I mean, y'know how you can Normal Summon/Set a monster, right? I meant like, "Special Summon Monsters 5 times in the same manner that you can Normal Summon." or "Special Summon anytime, without needing a card's effect."

That clear enough for ya?

But, honestly... I can't seem to get the "Normal Summon high level monsters without Tributing (e.g., Summon Blue-Eyes White Dragon without sacrificing 2 Monsters)." working for the AI, no matter what I type in. I tried "EFFECT_DECREASE_TRIBUTE", but that didn't work.

Edited by user Friday, January 26, 2018 7:45:41 PM(UTC)  | Reason: Not specified

salvadorc17  
#6 Posted : Sunday, January 28, 2018 8:39:58 PM(UTC)
salvadorc17

Rank: Advanced Member

Joined: 2/27/2013(UTC)
Posts: 537

Thanks: 6 times
Was thanked: 164 time(s) in 98 post(s)
The card of Emperor allow to Summon the level 5 or more monsters. When i created this ai in first version, i was not considering that, but after was good addition.
BananaPhone42  
#7 Posted : Monday, January 29, 2018 3:40:08 AM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: salvadorc17 Go to Quoted Post
The card of Emperor allow to Summon the level 5 or more monsters. When i created this ai in first version, i was not considering that, but after was good addition.


When you say "The Card of Emperor", do you mean the Mausoleum of the Emperor's effect? That's the only card I know that allows you to Summon higher ranking monsters without sacrificing, but in exchange you pay LP.
BananaPhone42  
#8 Posted : Tuesday, February 06, 2018 12:37:00 AM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
So... does anyone know how to get Ancient Rules to work for my A.I.?

BananaPhone42  
#9 Posted : Tuesday, February 06, 2018 7:41:54 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Because of what I found in searching for a cheating AI, I was able to find a way to increase your Hand capacity. See above for details.
salvadorc17  
#10 Posted : Tuesday, February 06, 2018 8:39:21 PM(UTC)
salvadorc17

Rank: Advanced Member

Joined: 2/27/2013(UTC)
Posts: 537

Thanks: 6 times
Was thanked: 164 time(s) in 98 post(s)
Sorry to say this, but none is longer interested about ancient rules, youre wasting time..
BananaPhone42  
#11 Posted : Tuesday, February 06, 2018 10:21:58 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: salvadorc17 Go to Quoted Post
Sorry to say this, but none is longer interested about ancient rules, youre wasting time..


Touche, however I must inform you that I've plenty of time on my hands, so I don't really care much (not to sound like a prick)... I don't really know how to implement Mausoleum of the Emperor's effect into AI. Same thing with Cost Down.

Edited by user Tuesday, February 06, 2018 10:23:27 PM(UTC)  | Reason: Not specified

BananaPhone42  
#12 Posted : Sunday, February 11, 2018 1:05:42 AM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
You want to have a permanent ATK/DEF boost? Well, with my new discovery, you most certainly can. See the first post for details. If you want to give these to your opponent instead, then give me a holler and I'll tell you how to.
BananaPhone42  
#13 Posted : Sunday, February 11, 2018 9:32:13 AM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: salvadorc17 Go to Quoted Post
Sorry to say this, but none is longer interested about ancient rules, youre wasting time..


I don't mean to brag, but uh... what was that about "wasting my time", Sal? I found out how to do everything I wanted and then some~. I'd say this little venture was quite fruitful. ;)

Edited by user Sunday, February 11, 2018 9:33:16 AM(UTC)  | Reason: Not specified

salvadorc17  
#14 Posted : Monday, February 12, 2018 8:58:59 PM(UTC)
salvadorc17

Rank: Advanced Member

Joined: 2/27/2013(UTC)
Posts: 537

Thanks: 6 times
Was thanked: 164 time(s) in 98 post(s)
Right, i know you can learn scripting doing this, but in terms of usability is not good for others, they would prefer harder AI mode, with more challenges..
BananaPhone42  
#15 Posted : Monday, February 12, 2018 9:44:52 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: salvadorc17 Go to Quoted Post
Right, i know you can learn scripting doing this, but in terms of usability is not good for others, they would prefer harder AI mode, with more challenges..


Fair enough, but these unfair advantages can be applied to the computer player. Just thought I'd point this out, and I can tell you how if you like?
kvanir  
#16 Posted : Thursday, June 21, 2018 4:38:21 AM(UTC)
kvanir

Rank: Newbie

Joined: 12/16/2017(UTC)
Posts: 1

How do I rewrite to give all these functions to AI instead?
BananaPhone42  
#17 Posted : Saturday, June 23, 2018 12:53:14 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
For anyone who cares to know, you can now Directly Attack your opponent. Secondly, for the effects to work for your opponent and not you, you merely need to reverse the "LOCATION_XXX,0" to "0,LOCATION_XXX" (XXX meaing MZONE, in this case.) Same thing for the "1,0" effects; change it to "0,1".
kiwi946  
#18 Posted : Tuesday, June 26, 2018 12:53:09 PM(UTC)
kiwi946

Rank: Newbie

Joined: 5/10/2018(UTC)
Posts: 5

Is Percy AI Support link summon now?
Why not start a AI with link summon?

kiwi946  
#19 Posted : Tuesday, June 26, 2018 12:53:44 PM(UTC)
kiwi946

Rank: Newbie

Joined: 5/10/2018(UTC)
Posts: 5

BananaPhone42  
#20 Posted : Tuesday, June 26, 2018 3:00:15 PM(UTC)
BananaPhone42

Rank: Advanced Member

Joined: 1/16/2018(UTC)
Posts: 113

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: kiwi946 Go to Quoted Post


What's the point of advertising that here, if you don't mind me asking?

Originally Posted by: kiwi946 Go to Quoted Post
Is Percy AI Support link summon now?
Why not start a AI with link summon?


For your first question, please refer to this this tweet: https://twitter.com/Ygop...tatus/975054083114590208 Many people have said numerous times that Percy's still working on the AI for the Link Summon support. For your second question, you're kidding, right? The version that can be download as of right now has no offline AI Support, never mind Link Support. Also, I do not know how to build an AI; I just put effects that can be used to your advantage against the AI for 1.033.D(a)

Edited by user Tuesday, June 26, 2018 3:04:17 PM(UTC)  | Reason: Not specified

Users browsing this topic
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error