Results 1 to 10 of 10

Thread: Pottery Crafting Script

  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Pottery Crafting Script

    Hey Guys

    I need some help with this script. I decided to open a new thread that will be global for the pottery Script I`m Working on. I might place some Request for help here from time to time, rather than creating a lot of different threads.

    This is the Code I`m currently having a problem with:

    Simba Code:
    WithdrawItem(DTM_SoftClay,'dtm',28,['ft cl'],[]);   // WithDraw item From Bank

    It was Assigned this value:
    Simba Code:
    DTM_SoftClay := DTMFromString('mggAAAHicY2NgYEhjZmCIBuJEIM4G4iIgjgfifCYGhmIgrgDiciDOBuI0IA534AXjBDc+hgBrbgZzDQ4wZgOahQ0z4sAQAAADdgiv');

    Declared Like This:
    Simba Code:
    DTM_SoftClay, DTM_Clay, DTM_PickAxe,DTM_SoftPot,DTM_FiredPot: Integer;

    My problem is that I keep Getting a type mismatch error, and I just can`t see where or how

    Here is the debug:
    Simba Code:
    [Error] (139:55): Type mismatch at line 138
    Compiling failed.

    So the code right at the top is line 138

    I know it must be some stupid mistake, but for the life of me I just cant see it.

    Here is the complete code for that procedure:
    Simba Code:
    // WithDraw Items and Equipment as needed from bank
    // Select Case To Use To withdraw Item.
    // If No Item Then Do Auto Switch Activity
    procedure WithDrawItems;
    var
    Temp:Integer;
    Begin
    DTM_SoftClay := DTMFromString('mggAAAHicY2NgYEhjZmCIBuJEIM4G4iIgjgfifCYGhmIgrgDiciDOBuI0IA534AXjBDc+hgBrbgZzDQ4wZgOahQ0z4sAQAAADdgiv');
    DTM_Clay := DTMFromString('mggAAAHicY2NgYEhjZmCIBuJEIM4G4iIgjgfifCYGhmIgrgDiciDOBuI0IA534AXjBDc+hgBrbgZzDQ4wZgOahQ0z4sAQAAADdgiv');
      Temp := 0
      Temp := CountInvItems('dtm', DTM_SoftClay, []);
                                  // First do A Search For the Item That is to be Withdrawn
    //  SearchBank('oft clay');
                                // If Item Found WithDraw Item, If Not Found, Switch Activity To Do
                                // Rather Use DTM ?
      If (Temp > 1) then
        Begin
          WithdrawItem(DTM_SoftClay,'dtm',28,['ft cl'],[]);   // WithDraw item From Bank
          Wait(500 + random(400));
          CloseBank;
          FreeDTM(DTM_SoftClay);
          Exit;
        End;
      If (Temp = 0) then
        Begin
          Temp := 0;
          Temp := CountInvItems('dtm', DTM_Clay, []);
          If (Temp > 27) then
            Begin
              ChooseActivity := 8;
            End;
              ChooseActivity := 0;
        End;
        FreeDTM(DTM_SoftClay);
        FreeDTM(DTM_Clay);
    End;

    I still need to make a dtm for the clay.

    I need some advice here, all input will be appreciated. Yes the code is not streamlined I know, but this will only be a beta script. Once I understand all the procedures I need to create a successful Crafting Script for pottery. I will create a More Valuable script that is much more easier to follow and organized. Still learning the ropes and pascal as well.

    Thanks for the help and advice.

  2. #2
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Simba Code:
    WithdrawItem(DTM_SoftClay,'dtm',28,['ft cl'],[])
    Turn that to:
    Simba Code:
    WithdrawItem(DTM_SoftClay,'dtm',28,['ft cl'],[1])

    Try that

  3. #3
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    It gives the same error. Have nothing to do with tolerance.

  4. #4
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    Simba Code:
    WithdrawItem(DTM_SoftClay,'dtm',28,['ft cl'],[1])
    Try that
    DTM's dont have tolerance, as they are tolerated when being made.

    There is actually a small error in the include, the function is not supposed to handle TStringArrays, it should be

    Simba Code:
    WithdrawItem(DTM_SoftClay,'dtm',28,'ft cl',[]);

  5. #5
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    @ pur3b100d That is how it looks in the original first post and is why I`m getting a type mismatch. What am I doing wrong?

    I looked at the function and it looks correct to me according to the sample they gave how to use it.

    The only thought I have is that maybe I`m using the function in the incorrect way. Is that possible?

    That you cant use this function to withdraw an item per se? But even if used wrong, it should still not give a type mismatch?

  6. #6
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by VastlySuperior View Post
    @ pur3b100d That is how it looks in the original first post and is why I`m getting a type mismatch. What am I doing wrong?

    I looked at the function and it looks correct to me according to the sample they gave how to use it.

    The only thought I have is that maybe I`m using the function in the incorrect way. Is that possible?

    That you cant use this function to withdraw an item per se? But even if used wrong, it should still not give a type mismatch?
    nope it doesn't look the same, it looks similar but not the same, look more closely

    // old code
    Simba Code:
    WithdrawItem(DTM_SoftClay,'dtm',28,['ft cl'],[]);
    // new code
    Simba Code:
    WithdrawItem(DTM_SoftClay,'dtm',28,'ft cl',[]);

  7. #7
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by VastlySuperior View Post
    @ pur3b100d That is how it looks in the original first post and is why I`m getting a type mismatch. What am I doing wrong?

    I looked at the function and it looks correct to me according to the sample they gave how to use it.

    The only thought I have is that maybe I`m using the function in the incorrect way. Is that possible?

    That you cant use this function to withdraw an item per se? But even if used wrong, it should still not give a type mismatch?
    I don't know if you've edited the original post or you didn't notice what pur3v100d changed, but something is wrong here :P

    You should be using 'ft cl' instead of ['ft cl'] since the WithdrawItem function is looking for a string.

    Edit: JK, he told you himself

  8. #8
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I`m so blind. Did not see what was changed. Just to let you know it is fine now. Just one question, why does it show the example then in that manner?

    Thanks Runaway and pur3b100d. Just blinders on my eyes I guess.

  9. #9
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by VastlySuperior View Post
    I`m so blind. Did not see what was changed. Just to let you know it is fine now. Just one question, why does it show the example then in that manner?

    Thanks Runaway and pur3b100d. Just blinders on my eyes I guess.
    I think nava2 is just trollin'

  10. #10
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by VastlySuperior View Post
    I`m so blind. Did not see what was changed. Just to let you know it is fine now. Just one question, why does it show the example then in that manner?

    Thanks Runaway and pur3b100d. Just blinders on my eyes I guess.

    As i said in my first post...There is actually a small error in the include. The best thing to do would be to also look at the include and understand datatypes. there's always help aslong as you search the forums first..

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
  •