[INACTIVE][FUN/ADMIN] FoundDiamonds 1.6 - Alerts for finding Ores! (Anti-Xray Mod too!) [860]

Discussion in 'Inactive/Unsupported Plugins' started by itsatacoshop247, Mar 27, 2011.

  1. Offline


    NEWS: OH HAI THUR. I am really not going to update this, but someone made new versions of this:

    FoundDiamonds - PvP inspired/Anti-Xray
    Version: v1.6

    This plugin sends a server wide alert when someone finds diamonds. It is then disabled for 30 seconds s0 that
    there won't be chat spam when someone finds a vein of diamonds.
    Also, theres a 10% everyone else will get something when someone find diamonds too. 5% to get 1-5 of something, and another 5% to get 6-10 of something. The default is 1-5 iron ignots, and 6-10 Coal, but it is changeable in the config!
    I just made this as my first plugin to use on my own server, to hopefully make people want to PvP someone who finds
    diamonds, so its not very advanced :p

    Use '/settrap' to create a diamond vein at your feet (need FD.admin permssion or be in ops.txt)
    Just make sure to put this in a spot where someone would obviously have to use Xray to find it, and when they do find it, It will log it, display a message, and kick the player (Optional)(I'll add and option Ban later)

    Heres a quick video:

    Video of the /settrap usage

    * Server Wide Message
    * Logging when diamonds found!
    * Gives good reason to kill
    * Permissions! add - 'FD.admin' too see all ore breaks. (or less, configurable)
    * Configurable message, colored by type of Ore
    * Ability to set traps designed to catch X-ray Users

    Download Jar- <Edit by Moderator: Redacted mediafire url>
    Another DL if the mediafire doesnt work for you
    If you dont want the /settrap command, <Edit by Moderator: Redacted mediafire url>

    Source Code - https://github.com/itsatacoshop247/FoundDiamonds

    Config Settings:
    Set the ones with 'true' to 'false' to disable them.
    diamond=true //determines whether diamond alerts are shown
    showmmessage=true //determines whether any messages are shown at all
    redstone=true //determines whether redstone alerts are shown
    kickontrapbreak=true //kick the player when they break a trap? (cant ban yet, sorry)
    thirtysecondwait=true  //determines whether the plugin waits 30seconds to show another maessage
    gold=true //determines whether gold alerts are shown
    item1=263 //declare the item to give
    lupuslazuli=true //determines whether lapis alerts are shown
    item2=265 //declare the item to give
    randomitems=true //decide whether the random items feature is active.
    iron=true //determines whether iron alerts are shown
    Broadcast_Message=@Player@ just found @BlockName@! //change what is said when someone finds an ore
    chanceitem1=5//chance to get item one (out of 100%)
    chanceitem2=5//chance to get item two (out of 100%)
    redstone\ admin=true //all of the ones with 'admin's change whether someone with
    gold\ admin=true //the permission 'FD.admin' sees all breaks of this block
    lupuslazuli\ admin=truee //be warned, all admin set to true can be very annoying in chat
    iron\ admin=true
    diamond\ admin=true
    logging=true //do you want it to log when someone find diamonds?
    Version 1.6
    * Traps!
    * Chance to get the random items!

    Version 1.5
    * Logging added finally!
    * Option to turn logging on/off

    Version 1.3

    * Works better with Permissions, defaults to OP list if no Permissions
    * Configurable message
    * Beta 1.4 Compatible

    Version 1.2

    * Permissions!
    * 'FD.admin' to see all block breaks

    Version 1.1

    * Added more to config
    * Added ores, options for each to be on/off
    * Turn server message on/off
    * random item give on/off

    Version 1

    * Release

    * Suggest things!

    If you looking for more Anti-Cheat options, check out <font color="rgb(16, 97, 179)">this plugin</font> by Evenprime!
    Last edited by a moderator: Dec 14, 2016
  2. Offline


    You just copy the text from the code block and paste into Notepad. Save it as whatever you want .VBS. Then navigate to the .VBS file you saved and double click it.

    Use the following code, as I've converted it to run w/o having to go into the command prompt:
    LogFileLocation = "C:\Games\Minecraft\plugins\FoundDiamonds\logs.txt"
    Set FS = CreateObject("Scripting.FileSystemObject")
    if not FS.FileExists(LogFileLocation) then Msgbox("I could not find the log file where you specified!"): wscript.quit
    if Msgbox("Restrict by date?", 4) = 6 then
      targetdate = Inputbox("Date to report on:")
      if not IsDate(targetdate) then Msgbox("Invalid date, aborting!"): wscript.quit
    end if
    if Msgbox("Restrict by user?", 4) = 6 then
      targetuser = Inputbox("User to report on:")
      if trim(targetuser) = "" then Msgbox("Invalid user, aborting!"): wscript.quit
    end if
    Dim Users(500), Dates(500), Data(500, 500), Times(500, 500), OutputDisp(2000)
    Dates(0) = 0: Users(0) = 0
    Set Infile = FS.OpenTextFile(LogFileLocation)
    do while not Infile.AtEndOfStream
      line = Infile.Readline
      logdate = cdate(mid(line, 7, 11))
      if (datediff("d", logdate, targetdate) = 0) or (targetdate = "") then
        loguser = lcase(trim(mid(line, 51, instr(line, "at (")-51)))
        if loguser = targetuser or targetuser = "" then
          uindex = 0
          for x=1 to Users(0)
            if Users(x) = loguser then uindex = x: exit for
          if uindex = 0 then Users(0) = Users(0) + 1: Users(Users(0)) = loguser: uindex = Users(0)
          dindex = 0
          for x=1 to Dates(0)
            if logdate = Dates(x) then dindex = x: exit for
          if dindex = 0 then
            Dates(0) = Dates(0) + 1: Dates(Dates(0)) = logdate: dindex = Dates(0)
          end if
          Data(uindex, dindex) = Data(uindex, dindex) + 1
          Times(uindex, dindex) = Times(uindex, dindex) & mid(line,19, 8) & ";"
        end if
      end if
    Infile.Close: Set Infile = Nothing
    for x=1 to Users(0)
      OutputDisp(0) = OutputDisp(0) + 1: OutputDisp(OutputDisp(0)) = "USER " & ucase(Users(x)) & ":" & vbCRLF
      for y=1 to Dates(0)
        if Data(x, y) > 0 then
          tmpArray = split(Times(x,y), ";")
          if ubound(tmpArray) > 1 then timespan = "  (" & timedisp(datediff("s", tmpArray(0), tmpArray(ubound(tmpArray)-1))) & ")" else timespan = ""
          OutputDisp(0) = OutputDisp(0) + 1: OutputDisp(OutputDisp(0)) = "  " & Dates(y) & ": " & Data(x, y) & timespan & vbCRLF
        end if
      OutputDisp(0) = OutputDisp(0) + 1: OutputDisp(OutputDisp(0)) = vbCRLF
    for x=1 to OutputDisp(0)
      tmp = tmp & OutputDisp(x)
      if x mod 30 = 0 then Msgbox(tmp): tmp = ""
    if OutputDisp(0) < 30 then Msgbox(tmp)
    Set FS = Nothing
    Function timedisp(seconds)
      if seconds > 0 then
        days = int(seconds / 86400): daysec = days * 86400
        hours = int((seconds - daysec) / 3600)
        hoursec = hours * 3600
        minutes = int((seconds - (daysec + hoursec)) / 60)
        minsec = minutes * 60
        seconds = (seconds - (daysec + hoursec + minsec))
        if (seconds = 60) then minutes = minutes + 1: seconds = 0
        if (minutes = 60) then hours = hours + 1: minutes = 0
        if (hours = 24) then days = days + 1: hours = 0
        if (days > 0) then retval = retval & days & pluralize(" day^s, ", days)
        if (hours > 0) then retval = retval & hours & pluralize(" hour^s, ", hours)
        if (minutes > 0) then retval = retval & minutes & pluralize(" minute^s, ", minutes)
        if (seconds > 0) then retval = retval & seconds & pluralize(" second^s, ", seconds)
        timedisp = left(retval, len(retval)-2)
        timedisp = "0 seconds"
      end if
    End Function
    Function Pluralize(tmpDisplay, tmpVar)
      if tmpVar > 1 then
        tmpDisplay = replace(tmpDisplay, "^s", "s")
        tmpDisplay = replace(tmpDisplay, "^ia", "are")
        tmpDisplay = replace(tmpDisplay, "^ww", "were")
        tmpDisplay = replace(tmpDisplay, "^s", "")
        tmpDisplay = replace(tmpDisplay, "^ww", "was")
      end if
      Pluralize = tmpDisplay
    End Function
  3. Offline


    Line: 21
    Char: 3
    Error: Type mismatch: 'cdate'
    Code: 800A000D
  4. Offline


    Great plugin. I'm just having a small issue whenever I type /settrap it appears in white as the command typed and it sets no trap and does nothing. I'm not sure why but any help would be great. Thanks
  5. Offline


    Can you add the option for the admin, to get only all x-seconds a message for founded items?

    If a lode is broken, all items creates a message.

    maybe like :
    #value in seconds to wait (0 is no waiting)

    and can you log the other ore's to the logfile?

    Now only diamond will logged. What's with gold, iron, lapis, redstone etc.?
    Maybe in different files?

    etc. ?
  6. Offline


    I think there's still a lot of confusion regarding the traps.

    When you say "in a spot that only someone with x-ray would find it," it might help to elaborate on what those even mean to you. In areas that aren't near any caverns/lava? Levels other than the diamond level? Where should the average operator put these things in your opinion?

    Someone else asked what I was going to: isn't it possible for someone who is not using XRay to stumble across it and activate it? That could be the biggest problem of all if so.
  7. Offline


    IMO, it's easy to tell if someone went for it or found it by accident, if you /tp to them and look to see if they were stripmining and found it or if there's like a straight line towards it that looked highly suspicious
  8. Offline


    Hmm, odd. I just copied the code from your quoted reply and it works fine. -shrug- Maybe something got funky in the copy/paste. http://minecraft.nischan.com/logparse.zip You can try that one.
    vapid2323 likes this.
  9. Offline


    Works like a charm, would be nice to get the output in notepad tho
  10. Offline


    Redownload that link, I updated it to do that.
  11. Offline


    Ok well i'm still getting the same error, and I used the version u gave and changed the logs location etc.
    Maybe I'm typing the dates in the wrong format? It still doesn't work even if i choose not to specify a date though :/
  12. Offline



    Just a few things. Could you make it configureable to add redstone/lapis/gold logable too. Intead of just Diamond.

    And I found a bug. On our server we have Iconomy and the ores shop has 'ores' in them. they are zone protected so they can't be mined. How ever, when someone mines the diamond, people will still get the iron. But the diamond respawns due to zone protection. This way you can get tons of iron within minutes.

    Could you add a delay or a check if mined or similar to prevent this from happening?

    Other then that, great plugin.
  13. Offline


    hello :)

    it is possible to add economy?

    diamond = -40 coins (for example)

    Taxe! :p
  14. Offline


    This would be awesome. I would really love it to log gold and not just diamond. Our economy is based on gold, so I rather make sure no one is xraying and getting 50 gold every 5 minutes. Yes I know there is the anti xray plug in, but I had nothing but trouble with it so far, so I am going back to this.
  15. Offline


  16. Offline


    2 (hopefully simple) requests:
    • When logging, can you please include the world the location is related to?
    • Can you make it so logging of non-diamonds works? My config file here: http://pastebin.com/ZHBa6pSA Basically diamond=true, gold=true and iron=true, Log_Ore_Finding?=true and just about every other option is off, and yet, only Diamonds are logged. I'd like to see other ores too - maybe even in their own log files? Or at least an option to be in their own files? Would be great!
  17. Offline


    Very cool!
    Working! Thanks:)
  18. Offline


    work on 953?
  19. Offline


    does this work with 1.7.2 ?
  20. Offline


    Works just fine.

    I'm once again suggesting. Could you add redstone / gold / lapis logging as well? Would be great if you could log those too in seperate log files. If you'd add that, you'd be my hero :p
  21. Offline


    yes no problems so far b953
  22. Offline


    I have the exact same suggestion as morganm. I only want to log my players without they noticing anything and it would be extremely helpful if the plugin would not only log diamonds but also iron, redstone, etc. Right now he only logs diamonds no matter how the config file looks like
  23. Offline


    Would be nice to have ALARMS logged only when certain xx diamond treshlod per last yy minutes is mined out (configurable). That is far more accurate way to find out cheaters. Also some time based stats like /top [x players] [ore] [last xx minutes/days]. that would make this absolutly perfect.
  24. Offline


    That sounds like a useful feature. I'm manually perusing the files and sometimes sitting there diving up the lines to figure out how many nodes it was, comparing times etc. Kind of a process...
  25. Offline


    Is there anything that would make the log be blank even when set to true? I've had this plugin installed for quite some time and a few players have accused someone of using X-Ray....I go to check the log and see that it is empty!
  26. Offline


    Can you add custom log patch to config? I think this can be very useful.
  27. Offline


    I get the same error, which sucks, i wanted to have that script to run for the ease of access :)
  28. Offline


    I bet im not the only one asking, but could you please add support for custom items, and support for custom messages? :)

    For this Plugin, you get: [cake][cake][cake][cake][cake]!
  29. Offline


    Well, I don't mind Xray users. It's kind of hard finding ores with it anyway, but it's easy to see underground rooms, which I don't like. Other than that, I don't really see a reason to hate on Xray'ers so much.
  30. Offline


    Yes, it's pretty hard to find ores using it.

    Show Spoiler
  31. Offline


    Seems to be working on 1000...

Share This Page