ereinion icon

Pantogram1

ereinion | PRO | 05/09/18 08:02:43 PM UTC | 0 ⭐ | 326 👁️ | Never ⏰ | []
JavaScript |

3.79 KB

|

None

|

0 👍

/

0 👎

void usepanto(string modreq)
{
    item p = $item[portable pantogram];
    
    #pantogram_items (see item static list above)
    if    ( item_amount(p) == 0 )
    {
        #no iotm
        return;
    }
    
    if    ( get_property("_pantogramModifier") != "" )
    {
        #already used today
        return;
    }
    
    #==========================================================================
    #usage info & example links - pantogram
    #==========================================================================
        
        /* pantogram example - barf farm setup +60 meat
 
        use panto link: inv_use.php?pwd&which=99&whichitem=9573
        
        example creation link:
        mus +10 & st.res & HP +40 & -com & (req porquoise X1 i#706) +60% meat
        params?: m[mus/mys/mox] e[ele res] (sacrifices) s1[left?] s2[right of page] s3[middle?]
        %2C = comma
        negative numbers for non-item sacrifices
        LINK: choice.php?whichchoice=1270&pwd&option=1&m=1&e=5&s1=-1%2C0&s2=706%2C1&s3=-2%2C0
        _pantogramModifier = Muscle: 10, Stench Resistance: 2, Maximum HP: 40, Meat Drop: 60, Combat Rate: 5, Lasts Until Rollover: true
        
         */
    #==========================================================================
    #END usage info & example links - pantogram
    
    boolean use_pp()
    {
        string upp = visit_url("inv_use.php?pwd&which=99&whichitem=9573");
        
        if    ( upp.index_of("You've already summoned") > -1 )
        {
            return false;
        }
        
        return true;
    }
    
    #http://kol.coldfront.net/thekolwiki/index.php/Pantagramming#Pant_Modifiers
    #modreq values
    #barffarm = Muscle: 10, Stench Resistance: 2, Maximum HP: 40, Meat Drop: 30 [taco shell 173], Combat Rate: 5
    #meat+c = Muscle: 10, Stench Resistance: 2, Maximum HP: 40, Meat Drop: 30 [taco shell 173], Combat Rate: 5
    #barffarm60 = Muscle: 10, Stench Resistance: 2, Maximum HP: 40, Meat Drop: 60 [porquoise 706], Combat Rate: 5
    #meat60+c = Muscle: 10, Stench Resistance: 2, Maximum HP: 40, Meat Drop: 60 [porquoise 706], Combat Rate: 5
    
    #%2C = comma
    #mafia will encode a '%' sign as %25 if used in the url - so %2C is submitted as %252C
    #from session log:
    #choice.php?whichchoice=1270&pwd&option=1&m=1&e=5&s1=-1%252C0&s2=706%252C1&s3=-2%252C0
    #this produces pants with only the m= & e= enchantments
    
    #http://wiki.kolmafia.us/index.php?title=Visit_url
    #buffer visit_url(string page ,boolean use_POST (def T) , boolean encoded (def F) )
    #performing a POST request if use_POST is omitted or true, or a GET request if false.
    #encoded is false if the parameter is not used. If set to true, then the url is assumed to be pre-encoded by the user.
    
    string getpants = "";
    #+com, +30% mt
    if    ( modreq == "barffarm" || modreq == "meat+c" )
    {
        if    ( logrtrv(1,$item[taco shell]) )
        {
            if    ( use_pp() )
            {
                getpants = visit_url("choice.php?whichchoice=1270&pwd&option=1&m=1&e=5&s1=-1%2C0&s2=173%2C1&s3=-2%2C0",true,true);
            }
        }
    }
    
    #+com, +60% mt
    if    ( modreq == "barffarm60" || modreq == "meat60+c" )
    {
        if    ( logrtrv(1,$item[porquoise]) )
        {
            if    ( use_pp() )
            {
                getpants = visit_url("choice.php?whichchoice=1270&pwd&option=1&m=1&e=5&s1=-1%2C0&s2=706%2C1&s3=-2%2C0",true,true);
            }
        }
    }
    
    #exit choice with nothing (ch#2 ?)
    if    ( getpants == "" )
    {
        getpants = visit_url("choice.php?whichchoice=1270&pwd&option=2");
    }
    else
    {
        bigp("PANTO: "+get_property("_pantogramModifier"),"green",3);
    }
    
    return;
}

Comments