Results 1 to 11 of 11

Thread: Need Passing Variables help

  1. #1
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default Need Passing Variables help

    the below script should pass the herb_text and Herb_dtm variables on to the next function or procedure, but it's not. What am I doing wrong? I have a few things commented out for testing while. It compiles but fails to pass the variables. i have a for loop in the beginning of the Get_Herb_Info procedure, to show that the variable is loaded. it eveything was working poperly it should print this:

    Clean g
    ean guam
    an guam
    Guam
    Clean g
    ean guam
    an guam

    Simba Code:
    ////////////////////Ignore This Part////////////////////////
    program New;                                              //
    //{$DEFINE SMART}                                         //
    {$i srl/srl.scar}                                         //
    var x,y,next :integer;



                                          //
    const                                                   //
    ////////////////////////////////////////////////////////////
    Select_Task  = 1; // 0 = Clean berbs. 1 = Make potions
    Tolerance = 15;
    AreaSize  = 0;
    AreaShape  = 0;
    ////////////////////////////////////////////////////////////
    ///////////////////Begining of Script///////////////////////
    ////////////////////////////////////////////////////////////


    function SetHerbDTM(Hcolor, Gcolor: integer): integer;
    var
      Sub_Pt: array[0..5] of TDTMPointDef;
      Main_Pt: TDTMPointDef;
      Herb_TDTM: TDTM;
    begin
      Main_Pt.x:=184;
      Main_Pt.y:=103;
      Main_Pt.areasize:=1;
      Main_Pt.areashape:=0;
      Main_Pt.color:=Hcolor;
      Main_Pt.tolerance:=10;

      Sub_Pt[0].x:=192;
      Sub_Pt[0].y:=109;
      Sub_Pt[0].areasize:=AreaSize;
      Sub_Pt[0].areashape:=AreaShape;
      Sub_Pt[0].color:=Gcolor; //This color is green or brown for clean or grimy
      Sub_Pt[0].tolerance:=Tolerance;

      Sub_Pt[1].x:=198;
      Sub_Pt[1].y:=106;
      Sub_Pt[1].areasize:=AreaSize;
      Sub_Pt[1].areashape:=AreaShape;
      Sub_Pt[1].color:=131072 ;
      Sub_Pt[1].tolerance:=Tolerance;

      Sub_Pt[2].x:=189;
      Sub_Pt[2].y:=115;
      Sub_Pt[2].areasize:=AreaSize;
      Sub_Pt[2].areashape:=AreaShape;
      Sub_Pt[2].color:=131072 ;
      Sub_Pt[2].tolerance:=Tolerance;

      Sub_Pt[3].x:=183;
      Sub_Pt[3].y:=113;
      Sub_Pt[3].areasize:=AreaSize;
      Sub_Pt[3].areashape:=AreaShape;
      Sub_Pt[3].color:=131072 ;
      Sub_Pt[3].tolerance:=Tolerance;

      Sub_Pt[4].x:=175;
      Sub_Pt[4].y:=109;
      Sub_Pt[4].areasize:=AreaSize;
      Sub_Pt[4].areashape:=AreaShape;
      Sub_Pt[4].color:=131072 ;
      Sub_Pt[4].tolerance:=Tolerance;

      Sub_Pt[5].x:=172;
      Sub_Pt[5].y:=104;
      Sub_Pt[5].areasize:=AreaSize;
      Sub_Pt[5].areashape:=AreaShape;
      Sub_Pt[5].color:=131072 ;
      Sub_Pt[5].tolerance:=Tolerance;

      Herb_TDTM.MainPoint := Main_Pt;
      Herb_TDTM.SubPoints := Sub_Pt;
      Result := AddDTM(Herb_TDTM);
    end;


    procedure Get_Herb_Info(herb:string; Herb_Text: TStringArray; Herb_DTM: integer);

    begin
      case herb of
        'Guam'       : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                           for next:=0 to high(Herb_Text) do
                              writeln(Herb_Text[next])
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Marrentill' : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Tarromin'   : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Harralander': begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Ranarr'     : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Toadflax'   : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'SpiritWeed' : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Irit'       : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Wergali'    : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Avantoe'    : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Kwuarm'     : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Snapdragon' : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Cadantine'  : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Lantadyme'  : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'DwarfWeed'  : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Torstol'    : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Fellstalk'  : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
      end;
    end;


    {function Store_Item(item: string,
    begin

    end; }



    function Find_Item(x, y: integer; item: string): Boolean;
    var
      rightcount, downcount, Slotx, Sloty, DTM: integer;
      text: TStringArray;
    begin
      Slotx := 31;
      Sloty := 85;
      rightcount := 0;
      downcount := 0;
      Get_Herb_Info(item, text, DTM);
      repeat
        repeat
          if(FindDTM(DTM, x, y, Slotx, Sloty, Slotx + 44, Sloty + 44))then
          begin
            MMouse(x - 5, y - 5, 10, 10);
          end;
          Slotx := Slotx + 44;
          rightcount := rightcount + 1;
        until(IsUpTextMultiCustom([text]))or(rightcount >= 9)
        Sloty := Sloty + 44;
        Slotx := 31;
        downcount := downcount + 1;
      until(IsUpTextMultiCustom([text]))or(downcount >= 3)
      if(IsUpTextMultiCustom([text]))then Result:= true;
    end;

    procedure Get_Item(item: string);
    var
    DTM,i: integer;
    text: TStringArray;
    begin
      //if(Find_Item(x,y,item))then
      //begin
        //Store_Item(x,y,item)
        //Mouse(x, y, 0, 0, false);
      //end else writeln('Could not find ' + item);
      Get_Herb_Info(item, text, DTM);
      writeln(item)
      for i:=0 to high(text) do
       writeln(text[i])
    end;


    begin
    ClearDebug();
    //Smart_Server := 44;
    SetupSRL();

    //Withdraw_Herbs('Guam');
    Get_Item('Guam')


    end.

  2. #2
    Join Date
    Apr 2007
    Posts
    581
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    What are you setting 'DTM' to in procedure Get_Item?

    Edit: Seems I totally skipped a line, my mistake.
    Last edited by ShawnjohnSJ; 01-05-2012 at 08:08 AM.

  3. #3
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    ////////////////////Ignore This Part////////////////////////
    program New;                                              //
    //{$DEFINE SMART}                                         //
    {$i srl/srl.scar}                                         //
    var x,y,next :integer;



                                          //
    const                                                   //
    ////////////////////////////////////////////////////////////
    Select_Task  = 1; // 0 = Clean berbs. 1 = Make potions
    Tolerance = 15;
    AreaSize  = 0;
    AreaShape  = 0;
    ////////////////////////////////////////////////////////////
    ///////////////////Begining of Script///////////////////////
    ////////////////////////////////////////////////////////////


    function SetHerbDTM(Hcolor, Gcolor: integer): integer;
    var
      Sub_Pt: array[0..5] of TDTMPointDef;
      Main_Pt: TDTMPointDef;
      Herb_TDTM: TDTM;
    begin
      Main_Pt.x:=184;
      Main_Pt.y:=103;
      Main_Pt.areasize:=1;
      Main_Pt.areashape:=0;
      Main_Pt.color:=Hcolor;
      Main_Pt.tolerance:=10;

      Sub_Pt[0].x:=192;
      Sub_Pt[0].y:=109;
      Sub_Pt[0].areasize:=AreaSize;
      Sub_Pt[0].areashape:=AreaShape;
      Sub_Pt[0].color:=Gcolor; //This color is green or brown for clean or grimy
      Sub_Pt[0].tolerance:=Tolerance;

      Sub_Pt[1].x:=198;
      Sub_Pt[1].y:=106;
      Sub_Pt[1].areasize:=AreaSize;
      Sub_Pt[1].areashape:=AreaShape;
      Sub_Pt[1].color:=131072 ;
      Sub_Pt[1].tolerance:=Tolerance;

      Sub_Pt[2].x:=189;
      Sub_Pt[2].y:=115;
      Sub_Pt[2].areasize:=AreaSize;
      Sub_Pt[2].areashape:=AreaShape;
      Sub_Pt[2].color:=131072 ;
      Sub_Pt[2].tolerance:=Tolerance;

      Sub_Pt[3].x:=183;
      Sub_Pt[3].y:=113;
      Sub_Pt[3].areasize:=AreaSize;
      Sub_Pt[3].areashape:=AreaShape;
      Sub_Pt[3].color:=131072 ;
      Sub_Pt[3].tolerance:=Tolerance;

      Sub_Pt[4].x:=175;
      Sub_Pt[4].y:=109;
      Sub_Pt[4].areasize:=AreaSize;
      Sub_Pt[4].areashape:=AreaShape;
      Sub_Pt[4].color:=131072 ;
      Sub_Pt[4].tolerance:=Tolerance;

      Sub_Pt[5].x:=172;
      Sub_Pt[5].y:=104;
      Sub_Pt[5].areasize:=AreaSize;
      Sub_Pt[5].areashape:=AreaShape;
      Sub_Pt[5].color:=131072 ;
      Sub_Pt[5].tolerance:=Tolerance;

      Herb_TDTM.MainPoint := Main_Pt;
      Herb_TDTM.SubPoints := Sub_Pt;
      Result := AddDTM(Herb_TDTM);
    end;


    procedure Get_Herb_Info(herb:string; var Herb_Text: TStringArray; var Herb_DTM: integer);

    begin
      case herb of
        'Guam'       : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                           for next:=0 to high(Herb_Text) do
                              writeln(Herb_Text[next])
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Marrentill' : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Tarromin'   : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Harralander': begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Ranarr'     : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Toadflax'   : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'SpiritWeed' : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Irit'       : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Wergali'    : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Avantoe'    : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Kwuarm'     : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Snapdragon' : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Cadantine'  : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Lantadyme'  : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'DwarfWeed'  : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Torstol'    : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
        'Fellstalk'  : begin
                         if(Select_Task = 1)then
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Clean g', 'ean guam', 'an guam'];
                         end else
                         begin
                           Herb_DTM := SetHerbDTM(604423, 1980229);
                           Herb_Text :=  ['Grimy g', 'imy guam','my guam'];
                         end;
                       end;
      end;
    end;


    {function Store_Item(item: string,
    begin

    end; }



    function Find_Item(x, y: integer; item: string): Boolean;
    var
      rightcount, downcount, Slotx, Sloty, DTM: integer;
      text: TStringArray;
    begin
      Slotx := 31;
      Sloty := 85;
      rightcount := 0;
      downcount := 0;
      Get_Herb_Info(item, text, DTM);
      repeat
        repeat
          if(FindDTM(DTM, x, y, Slotx, Sloty, Slotx + 44, Sloty + 44))then
          begin
            MMouse(x - 5, y - 5, 10, 10);
          end;
          Slotx := Slotx + 44;
          rightcount := rightcount + 1;
        until(IsUpTextMultiCustom([text]))or(rightcount >= 9)
        Sloty := Sloty + 44;
        Slotx := 31;
        downcount := downcount + 1;
      until(IsUpTextMultiCustom([text]))or(downcount >= 3)
      if(IsUpTextMultiCustom([text]))then Result:= true;
    end;

    procedure Get_Item(item: string);
    var
    DTM,i: integer;
    text: TStringArray;
    begin
      //if(Find_Item(x,y,item))then
      //begin
        //Store_Item(x,y,item)
        //Mouse(x, y, 0, 0, false);
      //end else writeln('Could not find ' + item);
      Get_Herb_Info(item, text, DTM);
      writeln(item)
      for i:=0 to high(text) do
       writeln(text[i])
    end;


    begin
    ClearDebug();
    //Smart_Server := 44;
    SetupSRL();

    //Withdraw_Herbs('Guam');
    Get_Item('Guam')


    end.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  4. #4
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Or you could go pro with:

    Simba Code:
    ////////////////////Ignore This Part////////////////////////
    program New;                                              //
    //{$DEFINE SMART}                                         //
    {$i srl/srl.scar}

    type
      THerb = record
        Text : TStringArray;
        DTM : Integer;
    end;
                                            //
    var x,y,next :integer;



                                          //
    const                                                   //
    ////////////////////////////////////////////////////////////
    Select_Task  = 1; // 0 = Clean berbs. 1 = Make potions
    Tolerance = 15;
    AreaSize  = 0;
    AreaShape  = 0;
    ////////////////////////////////////////////////////////////
    ///////////////////Begining of Script///////////////////////
    ////////////////////////////////////////////////////////////


    function SetHerbDTM(Hcolor, Gcolor: integer): integer;
    var
      Sub_Pt: array[0..5] of TDTMPointDef;
      Main_Pt: TDTMPointDef;
      Herb_TDTM: TDTM;
    begin
      Main_Pt.x:=184;
      Main_Pt.y:=103;
      Main_Pt.areasize:=1;
      Main_Pt.areashape:=0;
      Main_Pt.color:=Hcolor;
      Main_Pt.tolerance:=10;

      Sub_Pt[0].x:=192;
      Sub_Pt[0].y:=109;
      Sub_Pt[0].areasize:=AreaSize;
      Sub_Pt[0].areashape:=AreaShape;
      Sub_Pt[0].color:=Gcolor; //This color is green or brown for clean or grimy
      Sub_Pt[0].tolerance:=Tolerance;

      Sub_Pt[1].x:=198;
      Sub_Pt[1].y:=106;
      Sub_Pt[1].areasize:=AreaSize;
      Sub_Pt[1].areashape:=AreaShape;
      Sub_Pt[1].color:=131072 ;
      Sub_Pt[1].tolerance:=Tolerance;

      Sub_Pt[2].x:=189;
      Sub_Pt[2].y:=115;
      Sub_Pt[2].areasize:=AreaSize;
      Sub_Pt[2].areashape:=AreaShape;
      Sub_Pt[2].color:=131072 ;
      Sub_Pt[2].tolerance:=Tolerance;

      Sub_Pt[3].x:=183;
      Sub_Pt[3].y:=113;
      Sub_Pt[3].areasize:=AreaSize;
      Sub_Pt[3].areashape:=AreaShape;
      Sub_Pt[3].color:=131072 ;
      Sub_Pt[3].tolerance:=Tolerance;

      Sub_Pt[4].x:=175;
      Sub_Pt[4].y:=109;
      Sub_Pt[4].areasize:=AreaSize;
      Sub_Pt[4].areashape:=AreaShape;
      Sub_Pt[4].color:=131072 ;
      Sub_Pt[4].tolerance:=Tolerance;

      Sub_Pt[5].x:=172;
      Sub_Pt[5].y:=104;
      Sub_Pt[5].areasize:=AreaSize;
      Sub_Pt[5].areashape:=AreaShape;
      Sub_Pt[5].color:=131072 ;
      Sub_Pt[5].tolerance:=Tolerance;

      Herb_TDTM.MainPoint := Main_Pt;
      Herb_TDTM.SubPoints := Sub_Pt;
      Result := AddDTM(Herb_TDTM);
    end;


    function Get_Herb_Info(herb:string) : THerb;
    begin
      case herb of
        'Guam'       : begin
                         if(Select_Task = 1)then
                         begin
                          with Result do
                          begin
                            DTM := SetHerbDTM(604423, 1980229);
                            Text := ['Clean g', 'ean guam', 'an guam'];
                          end;
                         end else
                         begin
                          with Result do
                          begin
                            DTM := SetHerbDTM(604423, 1980229);
                            Text := ['Grimy g', 'imy guam','my guam'];
                          end;
                         end;
                       end;

         // Repeated for each herb
      end;
    end;


    {function Store_Item(item: string,
    begin

    end; }



    function Find_Item(x, y: integer; item: string): Boolean;
    var
      rightcount, downcount, Slotx, Sloty : integer;
      zHerb : THerb;
    begin
      Slotx := 31;
      Sloty := 85;
      rightcount := 0;
      downcount := 0;
      zHerb := Get_Herb_Info(item);
      repeat
        repeat
          if(FindDTM(zHerb.DTM, x, y, Slotx, Sloty, Slotx + 44, Sloty + 44))then
          begin
            MMouse(x - 5, y - 5, 10, 10);
          end;
          Slotx := Slotx + 44;
          rightcount := rightcount + 1;
        until(IsUpTextMultiCustom([zHerb.Text]))or(rightcount >= 9)
        Sloty := Sloty + 44;
        Slotx := 31;
        downcount := downcount + 1;
      until(IsUpTextMultiCustom([zHerb.Text]))or(downcount >= 3)
      if(IsUpTextMultiCustom([zHerb.Text]))then Result:= true;
    end;

    procedure Get_Item(item: string);
    var
      zHerb : THerb;
      i : Integer;
    begin
      //if(Find_Item(x,y,item))then
      //begin
        //Store_Item(x,y,item)
        //Mouse(x, y, 0, 0, false);
      //end else writeln('Could not find ' + item);
      zHerb := Get_Herb_Info(item);
      writeln(item)
      for i:=0 to high(zHerb.Text) do
       writeln(zHerb.Text[i])
    end;


    begin
    ClearDebug();
    //Smart_Server := 44;
    SetupSRL();

    //Withdraw_Herbs('Guam');
    Get_Item('Guam');


    end.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  5. #5
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Thx alot i will look this over to see where I went wrong.

  6. #6
    Join Date
    Dec 2011
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    is there any ivy bot?

  7. #7
    Join Date
    Apr 2007
    Posts
    581
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    When passing variables, you need to put it like:
    Code:
    procedure proc(var i : Integer);
    instead of

    Code:
    procedure proc(i : Integer);
    Nick this isn't the place to ask for an ivy bot.. I suggest since you're new that you read the rules and use the search bar.

  8. #8
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Or you could go pro with:

    Simba Code:
    ////////////////////Ignore This Part////////////////////////
    program New;                                              //
    //{$DEFINE SMART}                                         //
    {$i srl/srl.scar}

    type
      THerb = record
        Text : TStringArray;
        DTM : Integer;
    end;
                                            //
    var x,y,next :integer;



                                          //
    const                                                   //
    ////////////////////////////////////////////////////////////
    Select_Task  = 1; // 0 = Clean berbs. 1 = Make potions
    Tolerance = 15;
    AreaSize  = 0;
    AreaShape  = 0;
    ////////////////////////////////////////////////////////////
    ///////////////////Begining of Script///////////////////////
    ////////////////////////////////////////////////////////////


    function SetHerbDTM(Hcolor, Gcolor: integer): integer;
    var
      Sub_Pt: array[0..5] of TDTMPointDef;
      Main_Pt: TDTMPointDef;
      Herb_TDTM: TDTM;
    begin
      Main_Pt.x:=184;
      Main_Pt.y:=103;
      Main_Pt.areasize:=1;
      Main_Pt.areashape:=0;
      Main_Pt.color:=Hcolor;
      Main_Pt.tolerance:=10;

      Sub_Pt[0].x:=192;
      Sub_Pt[0].y:=109;
      Sub_Pt[0].areasize:=AreaSize;
      Sub_Pt[0].areashape:=AreaShape;
      Sub_Pt[0].color:=Gcolor; //This color is green or brown for clean or grimy
      Sub_Pt[0].tolerance:=Tolerance;

      Sub_Pt[1].x:=198;
      Sub_Pt[1].y:=106;
      Sub_Pt[1].areasize:=AreaSize;
      Sub_Pt[1].areashape:=AreaShape;
      Sub_Pt[1].color:=131072 ;
      Sub_Pt[1].tolerance:=Tolerance;

      Sub_Pt[2].x:=189;
      Sub_Pt[2].y:=115;
      Sub_Pt[2].areasize:=AreaSize;
      Sub_Pt[2].areashape:=AreaShape;
      Sub_Pt[2].color:=131072 ;
      Sub_Pt[2].tolerance:=Tolerance;

      Sub_Pt[3].x:=183;
      Sub_Pt[3].y:=113;
      Sub_Pt[3].areasize:=AreaSize;
      Sub_Pt[3].areashape:=AreaShape;
      Sub_Pt[3].color:=131072 ;
      Sub_Pt[3].tolerance:=Tolerance;

      Sub_Pt[4].x:=175;
      Sub_Pt[4].y:=109;
      Sub_Pt[4].areasize:=AreaSize;
      Sub_Pt[4].areashape:=AreaShape;
      Sub_Pt[4].color:=131072 ;
      Sub_Pt[4].tolerance:=Tolerance;

      Sub_Pt[5].x:=172;
      Sub_Pt[5].y:=104;
      Sub_Pt[5].areasize:=AreaSize;
      Sub_Pt[5].areashape:=AreaShape;
      Sub_Pt[5].color:=131072 ;
      Sub_Pt[5].tolerance:=Tolerance;

      Herb_TDTM.MainPoint := Main_Pt;
      Herb_TDTM.SubPoints := Sub_Pt;
      Result := AddDTM(Herb_TDTM);
    end;


    function Get_Herb_Info(herb:string) : THerb;
    begin
      case herb of
        'Guam'       : begin
                         if(Select_Task = 1)then
                         begin
                          with Result do
                          begin
                            DTM := SetHerbDTM(604423, 1980229);
                            Text := ['Clean g', 'ean guam', 'an guam'];
                          end;
                         end else
                         begin
                          with Result do
                          begin
                            DTM := SetHerbDTM(604423, 1980229);
                            Text := ['Grimy g', 'imy guam','my guam'];
                          end;
                         end;
                       end;

         // Repeated for each herb
      end;
    end;


    {function Store_Item(item: string,
    begin

    end; }



    function Find_Item(x, y: integer; item: string): Boolean;
    var
      rightcount, downcount, Slotx, Sloty : integer;
      zHerb : THerb;
    begin
      Slotx := 31;
      Sloty := 85;
      rightcount := 0;
      downcount := 0;
      zHerb := Get_Herb_Info(item);
      repeat
        repeat
          if(FindDTM(zHerb.DTM, x, y, Slotx, Sloty, Slotx + 44, Sloty + 44))then
          begin
            MMouse(x - 5, y - 5, 10, 10);
          end;
          Slotx := Slotx + 44;
          rightcount := rightcount + 1;
        until(IsUpTextMultiCustom([zHerb.Text]))or(rightcount >= 9)
        Sloty := Sloty + 44;
        Slotx := 31;
        downcount := downcount + 1;
      until(IsUpTextMultiCustom([zHerb.Text]))or(downcount >= 3)
      if(IsUpTextMultiCustom([zHerb.Text]))then Result:= true;
    end;

    procedure Get_Item(item: string);
    var
      zHerb : THerb;
      i : Integer;
    begin
      //if(Find_Item(x,y,item))then
      //begin
        //Store_Item(x,y,item)
        //Mouse(x, y, 0, 0, false);
      //end else writeln('Could not find ' + item);
      zHerb := Get_Herb_Info(item);
      writeln(item)
      for i:=0 to high(zHerb.Text) do
       writeln(zHerb.Text[i])
    end;


    begin
    ClearDebug();
    //Smart_Server := 44;
    SetupSRL();

    //Withdraw_Herbs('Guam');
    Get_Item('Guam');


    end.

    I wouldn't be able to use the shorter function Get_Herb_Info, because each result is gonna be different. Guam is a different color than snapdragon, etc.

  9. #9
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Quote Originally Posted by ShawnjohnSJ View Post
    When passing variables, you need to put it like:
    Code:
    procedure proc(var i : Integer);
    instead of

    Code:
    procedure proc(i : Integer);
    Nick this isn't the place to ask for an ivy bot.. I suggest since you're new that you read the rules and use the search bar.
    ok great thx, I understand now.

    yep it worked all i did was add in var
    Last edited by bud_wis_er_420; 01-05-2012 at 09:22 PM.

  10. #10
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    I shortened it because I wasn't going to repeat it for each one That's why I put the "// Repeated for each one".
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  11. #11
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    ohhhhhhh lmao. My bad.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •