All pastes #838453 Raw Edit

Mine

public lua v1 · immutable
#838453 ·published 2007-12-30 11:18 UTC
rendered paste body
           if ${Me.FactionGroup.Equal["Horde"]}            {                ; Determine The most Densly Populated Zone Area.                ; posX, posY = GetPlayerMapPosition("player");                ; Check Reinforcements                ; GetWorldStateUIInfo(index)                Declare HordeLoc[6] int                Declare DefendLoc[6] int                Reinforce:Set[${WoWScript[GetWorldStateUIInfo("1"), 3]}] 		/* Gets the String for the Number of Reinforcements */                Reinforcements:Set[${Reinforce.Right[-16]}]								  /* Pulls out the number portion of the string */                ; Check to see if this game is established. if it just started go to default location                if ${Reinforcements} < 590                {                    while ${Count:Inc}<=40                    {                        ; Get Zone Areas                        ; * HordeLoc[1] = Balinda                        ; * HordeLoc[2] = Stonehearth                        ; * HordeLoc[3] = Stormpike                        ; * HordeLoc[4] = Aid Station                        ; * HordeLoc[5] = Vandaar                        ; Get Zone Areas                        ; * DefendLoc[1] = Galv                        ; * DefendLoc[2] = Tower Point                        ; * DefendLoc[3] = FrostWolf GY                        ; * DefendLoc[4] = Relief Hut                        ; * DefendLoc[5] = Drek                        RaidXCoords:Set[${WoWScript[GetPlayerMapPosition("Raid${Count}"), 1]}]                        RaidYCoords:Set[${WoWScript[GetPlayerMapPosition("Raid${Count}"), 2]}]                        ; For Pure Offense (Following the mob and no guarding)                       if (${AVOffense} || ${GlobalOffense}) && (!${AVDefend} || !${GlobalDefend}) && (!${AVGuard} || !${GlobalGuard})                        {                           if ${RaidXCoords} >= 0.49 && ${RaidXCoords} <= 0.48 && ${RaidYCoords} >= 0.38 && ${RaidYCoords} <= 0.39                           {                               HordeLoc[1]:Inc                           }                           elseif ${RaidXCoords} > 0.51 && ${RaidXCoords} <= 0.53 && ${RaidYCoords} > 0.29 && ${RaidYCoords} < 0.37                           {                               HordeLoc[2]:Inc                           }                           elseif ${RaidXCoords} >= 0.48 && ${RaidXCoords} < 0.50 && ${RaidYCoords} >= 0.14 && ${RaidYCoords} <= 0.22                           {                               HordeLoc[3]:Inc                           }                           elseif ${RaidXCoords} >= 0.42 && ${RaidXCoords} <= 0.49 && ${RaidYCoords} > 0.14 && ${RaidYCoords} < 0.16                           {                               HordeLoc[4]:Inc                           }                           elseif ${RaidXCoords} > 0.41 && ${RaidXCoords} < 0.43 && ${RaidYCoords} >= 0.13 && ${RaidYCoords} <= 0.14                           {                               HordeLoc[5]:Inc                           }                        for (Count:Set[1] ; ${Count}<=5 ; Count:Inc)                        {                            if ${Math.Calc[(${HordeLoc[${Count}]}*1.2)]} > ${HordeLoc[${HighZone}]}                            {                                HighZone:Set[${Count}]                            }                        }                        ; We dont want the bot stuck running partially between two zones. So lets prefer it goes to the zone it decided on last time                        ; Unless the other zone has a Higher numer IE its more offensive                        if !(${LastAVDest} != ${HighZone} && ${Math.Calc[(${HordeLoc[${LastAVDest}]}*1.2)]} < ${HordeLoc[${HighZone}]}) && !(${LastAVDest} < ${HighZone})                        {                            HighZone:Set[${LastAVDest}]                        }                        ; Keep Track of Destinations.                        LastAVDest:Set[${HighZone}]                        Switch ${HighZone}                        {                            case 1                                This:SetFightCoor["Balinda Stonehearth"]                                break                            case 2                                This:SetFightCoor["Stone Hearth GY"]                                break                            case 3                                This:SetFightCoor["Storm Pike GY"]                                break                            case 4                                This:SetFightCoor["Aid Station"]                                break                            case 5                                This:SetFightCoor["Vanndar Stormpike"]                                break                        }                         }                        ; For Pure Defend (Following the mob to defend points)                        if (!${AVOffense} || !${GlobalOffense}) && (${AVDefend} || ${GlobalDefend}) && (!${AVGuard} || !${GlobalGuard})                        {                           if ${RaidXCoords} >= 0.43 && ${RaidXCoords} <= 0.47 && ${RaidYCoords} >= 0.55 && ${RaidYCoords} <= 0.59                            {                               DefendLoc[1]:Inc                            }                            elseif ${RaidXCoords} >= 0.48 && ${RaidXCoords} <= 0.52 && ${RaidYCoords} >= 0.61 && ${RaidYCoords} <= 0.67                            {                                DefendLoc[2]:Inc                            }                            elseif ${RaidXCoords} >= 0.48 && ${RaidXCoords} <= 0.52 && ${RaidYCoords} >= 0.67 && ${RaidYCoords} <= 0.79                            {                                DefendLoc[3]:Inc                            }                            elseif ${RaidXCoords} >= 0.46 && ${RaidXCoords} <= 0.47 && ${RaidYCoords} >= 0.84 && ${RaidYCoords} <= 0.87                            {                                DefendLoc[4]:Inc                            }                            elseif ${RaidXCoords} >= 0.46 && ${RaidXCoords} <= 0.50 && ${RaidYCoords} >= 0.82 && ${RaidYCoords} <= 0.88                            {                                DefendLoc[5]:Inc                            }                        for (Count:Set[1] ; ${Count}<=5 ; Count:Inc)                        {                            if ${Math.Calc[(${DefendLoc[${Count}]}*1.2)]} > ${DefendLoc[${HighZone}]}                            {                                HighZone:Set[${Count}]                            }                        }                        ; We dont want the bot stuck running partially between two zones. So lets prefer it goes to the zone it decided on last time                        ; Unless the other zone has a Higher numer IE its more offensive                        if !(${LastAVDest} != ${HighZone} && ${Math.Calc[(${DefendLoc[${LastAVDest}]}*1.2)]} < ${DefendLoc[${HighZone}]}) && !(${LastAVDest} < ${HighZone})                        {                            HighZone:Set[${LastAVDest}]                        }                        ; Keep Track of Destinations.                        LastAVDest:Set[${HighZone}]                        Switch ${HighZone}                        {                            case 1                                This:SetFightCoor["Galvangar"]                                break                            case 2                                This:SetFightCoor["Tower Point"]                                break                            case 3                                This:SetFightCoor["Frost Wolf GY"]                                break                            case 4                                This:SetFightCoor["Relief Hut"]                                break                            case 5                                This:SetFightCoor["Drekthar"]                                break                        }                         }                        ; For Offense with Guarding of Flags until Captured.                       if (${AVOffense} || ${GlobalOffense}) && (!${AVDefend} || !${GlobalDefend}) && (${AVGuard} || ${GlobalGuard})                        {                            //Protect that flag until it changes                        }                        ; For Defense with Guarding of Flags until Lost.                       if (!${AVOffense} || !${GlobalOffense}) && (${AVDefend} || ${GlobalDefend}) && (${AVGuard} || ${GlobalGuard})                        {                            //Protect that flag until it changes                        }                       ; For Single Point Defend                       if (!${AVOffense} || !${GlobalOffense}) && (!${AVDefend} || !${GlobalDefend}) && (${AVGuard} || ${GlobalGuard})                        {                            SetFightCoor[${This.AVGuardSpot}]                        }                    }                } //main closer