Eclipse
January 05, 2009, 04:47:12 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
Rate the above user by The Oracle
Today at 04:46:53 PM

fun with photoshop by The MrMiguu™ [pizza pretzles]
Today at 04:46:22 PM

MyWorld by azkanan
Today at 04:42:08 PM

Open Book by The MrMiguu™ [pizza pretzles]
Today at 04:41:23 PM

Lostica [Project Revamp] by The MrMiguu™ [pizza pretzles]
Today at 04:39:56 PM

what? by The Oracle
Today at 04:36:33 PM

Merrimint's Website by The MrMiguu™ [pizza pretzles]
Today at 04:36:25 PM

J-HASP! by The Oracle
Today at 04:33:24 PM

Spike's Adminishness! by Dr. Who Cares
Today at 04:32:21 PM

The New Eclipse Raid on Runscape by DrNova
Today at 04:30:54 PM

Members Online +-
15 Guests, 27 Users
azkanan,
Hikaru,
The Oracle,
Niko,
Gwendalin,
FS:CG Admin[Shadowwulf],
Simius Cruentus,
The MrMiguu™ [pizza pretzles],
DrNova,
Dimx ♥ Pie,
Gh0st ...,
Munro,
Jarvis,
Maxac,
Jax The Mighty,
‪‫‬‭‮‪‫‬‭Admiral Refuge,
ploxie,
Almighty Wing,
Ambard,
Sk3wer,
Airscar,
chrisaub,
Chief,
ShadowChao,
Electrokinesis,
Dr. Who Cares,
Blue Fly
Pages: [1] 2
  Print  
Author Topic: Fishing / Mining  (Read 3110 times)
0 Members and 1 Guest are viewing this topic.
Marsh
Demi God

Offline Offline

Posts: 7,280


Comfort the disturbed. Disturb the comfortable.


View Profile WWW Email
User is on moderator watch listWatched
« on: August 10, 2005, 03:19:35 PM »

Difficulty: Moderate 2/5

Although, I already posted the scripts, i have found the right one's and they are fixed.

Mining Script


Explanation

This script will randomly generate a number, which will then allow you to find an ore, or find nothing...

The script is activated as soon as the player stands on the tile that the script is set to.

The higher your level, the easier it is for you to find the ore, or item. ^^



The Code

To install the mining script, follow the instructions below:



1) Find the blank part just above the 'Sub ScriptedTile(index, Script)' part in main.txt. I have shown it on the diagram below. This is NOT the code you have to copy and paste in.

Code:

Sub DropItems(index)
    If GetPlayerWeaponSlot(index) > 0 Then
        Call PlayerMapDropItem(index, GetPlayerWeaponSlot(index), 0)
    End If

    If GetPlayerArmorSlot(index) > 0 Then
        Call PlayerMapDropItem(index, GetPlayerArmorSlot(index), 0)
    End If
   
    If GetPlayerHelmetSlot(index) > 0 Then
        Call PlayerMapDropItem(index, GetPlayerHelmetSlot(index), 0)
    End If

    If GetPlayerShieldSlot(index) > 0 Then
        Call PlayerMapDropItem(index, GetPlayerShieldSlot(index), 0)
    End If
End Sub
###############BLANK PART!###############
Sub ScriptedTile(index, Script)
Select Case Script
    Case 0
        Call Flash(index, "Intro.swf")




2) Paste the following piece of script into the blank area that we just found (shown on the last diagram):

Code:

Sub ReplaceOneInvItem(index, olditem, newitem)
Dim n
n = 1
Do
   If GetPlayerInvItemNum(index, n) = olditem Then
      Call SetPlayerInvItemNum(index, n, newitem)
      Call SendInventoryUpdate(index, n)
      Exit Do
   End If
   n = n + 1
Loop Until n > 24
End Sub

Sub GoMining(index, item, maxlevel, name)
   Dim m
   Dim level
   level = maxlevel + 1
      If GetPlayerlevel(index) < maxlevel Then
         m = Int(Rnd * Int(level - GetPlayerLevel(index)))
         If m = 1 Then
            Call PlayerMsg(index, GetPlayerName(index) & " found " & name & " amongst the rocks.", 2)
            Call ReplaceOneInvItem(index, 0, item)
         Else
            Call PlayerMsg(index, GetPlayerName(index) & " found nothing interesting!", 12)
         End If
      Else
         Call PlayerMsg(index, GetPlayerName(index) & " found " & name & " amongst the rocks.", 2)
         Call ReplaceOneInvItem(index, 0, item)
      End If
End Sub




3)Ok. Now that you have pasted that part in, its time to add the part you will actually tread on.

Find the cases section within Main.txt, and then find the next case number that is not being used. For this demo, we will assume that we are on case 2 - However, some of you may be on different numbers

Code:

    Case 9
   dim weapon
   weapon = GetPlayerWeaponSlot(index)
   If weapon = 0 Then
      Call PlayerMsg(index, "You don't have a #EQUIPMENT NAME# equiped", 15)
      ElseIf GetPlayerInvItemNum(index, weapon) = #EQUIPMENT NUM# Then
      Call GoMining(index, #ORE NUM#, #MAX LEVEL#, "#ORE NAME")
      Else
      Call PlayerMsg(index, "You don't have a #EQUIPMENT NAME# equiped", 15)
   End If




Parts you need to change

#EQUIPMENT NUM# - This is the item number of the equipment you need to mine the rock (ie. a mining pickaxe).

#EQUIPMENT NAME# - This is the name of the equipment that you need to mine the ore (ie. a mining pickaxe).

#ORE NUM# - This is the number of the item that you want to be able to mine

#ORE NAME# - This is the name of the ore. Just change the name, DO NOT delete the quotation marks from around the name ^^.

#MAX LEVEL# - This is the level at which you will start to catch the fish 100% of the time

PLEASE NOTE: That, you can make it so that you can have more than one mining spot, by simply copying and pasting this code into a different free case slot further down, and changing the numbers around.
PM me if you get stuck XD



For the more advanced programmers

A more advanced programmer would notice that I have made two new Sub-Routines; called 'GoFishing' and 'ReplaceOneInvItem'. Any of you are welcome to use this subroutine, and I shall give you the Syntax for it:



GoMining(INDEX, ITEM, MAXLEVEL, "NAME")

-Sets the variables for going mining. Item, is the item number. Maxlevel, is the level at which you start obtaining the ore 100% of the time. Name, is the name of the ore - The name that's printed into the Player Message.

Example:Call GoFishing(index, 24, 5, "Metal Ore")



ReplaceOneInvItem(INDEX, OLDITEM, NEWITEM)

-This replaces just ONE of the items in your inventory with another item. Set the replace item to 0, to replace the item with an empty slot, or to fill the next empty slot.

Example:Call ReplaceOneInvItem(index, 24, 0)



However, some of you may be wondering why it is replace 'ONE' inv item. This is because i have made another which i shall also give you the syntax for ^^.



ReplaceAllInvItems(INDEX, OLDITEM, NEWITEM)

Will search every single slot in your inventory and replace an item with a new item. Set the replace item to 0, to replace the items with an empty slot, or to fill all the empty slots.

ExampleCall ReplaceAllInvItems(index, 24, 0)



And then, you will also need the code for this sub... (Although you DO NOT need this code to make the fishing script work)

Code:

Sub ReplaceAllInvItem(index, olditem, newitem)
Dim n
n = 1
Do
   If GetPlayerInvItemNum(index, n) = olditem Then
      Call SetPlayerInvItemNum(index, n, newitem)
      Call SendInventoryUpdate(index, n)
   End If
   n = n + 1
Loop Until n > 24
End Sub



Fishing Script

Explanation

This script will randomly generate a number, which will then allow you to catch a fish, or find nothing...

The script is activated as soon as the player stands on the tile that the script is set to.

The higher your level, the easier it is for you to catch the fish, or item. ^^



The Code

To install the fishing script, follow the instructions below:



1) Find the blank part just above the 'Sub ScriptedTile(index, Script)' part in main.txt. I have shown it on the diagram below. This is NOT the code you have to copy and paste in.

Code:

Sub DropItems(index)
    If GetPlayerWeaponSlot(index) > 0 Then
        Call PlayerMapDropItem(index, GetPlayerWeaponSlot(index), 0)
    End If

    If GetPlayerArmorSlot(index) > 0 Then
        Call PlayerMapDropItem(index, GetPlayerArmorSlot(index), 0)
    End If
   
    If GetPlayerHelmetSlot(index) > 0 Then
        Call PlayerMapDropItem(index, GetPlayerHelmetSlot(index), 0)
    End If

    If GetPlayerShieldSlot(index) > 0 Then
        Call PlayerMapDropItem(index, GetPlayerShieldSlot(index), 0)
    End If
End Sub
###############BLANK PART!###############
Sub ScriptedTile(index, Script)
Select Case Script
    Case 0
        Call Flash(index, "Intro.swf")





2) Paste the following piece of script into the blank area that we just found (shown on the last diagram):

Code:

Sub ReplaceOneInvItem(index, olditem, newitem)
Dim n
n = 1
Do
   If GetPlayerInvItemNum(index, n) = olditem Then
      Call SetPlayerInvItemNum(index, n, newitem)
      Call SendInventoryUpdate(index, n)
      Exit Do
   End If
   n = n + 1
Loop Until n > 24
End Sub

Sub GoFishing(index, item, maxlevel, name)
   Dim c
   Dim level
   level = maxlevel + 1
      If GetPlayerlevel(index) < maxlevel Then
         c = Int(Rnd * Int(level - GetPlayerLevel(index)))
         If c = 1 Then
            Call PlayerMsg(index, GetPlayerName(index) & " caught a " & name, 2)
            Call ReplaceOneInvItem(index, 0, item)
         Else
            Call PlayerMsg(index, GetPlayerName(index) & " found nothing!", 12)
         End If
      Else
         Call PlayerMsg(index, GetPlayerName(index) & " caught a " & name, 2)
         Call ReplaceOneInvItem(index, 0, item)
      End If
End Sub





3)Ok. Now that you have pasted that part in, its time to add the part you will actually tread on.

Find the cases section within Main.txt, and then find the next case number that is not being used. For this demo, we will assume that we are on case 2 - However, some of you may be on different numbers

Code:

    Case 9
   dim weapon
   weapon = GetPlayerWeaponSlot(index)
   If weapon = 0 Then
      Call PlayerMsg(index, "You don't have a #EQUIPMENT NAME# equiped", 15)
      ElseIf GetPlayerInvItemNum(index, weapon) = #EQUIPMENT NUM# Then
      Call GoFishing(index, #FISH NUM#, #MAX LEVEL#, "#FISH NAME")
      Else
      Call PlayerMsg(index, "You don't have a #EQUIPMENT NAME# equiped", 15)
   End If





Parts you need to change

#EQUIPMENT NUM# - This is the item number of the equipment you need to catch the fish (ie. a fishing net).

#EQUIPMENT NAME# - This is the name of the equipment that you need to catch the fish (ie. a fishing net).

#FISH NUM# - This is the number of the item that you want to be able to catch

#FISH NAME# - This is the name of the fish. Just change the name, DO NOT delete the quotation marks from around the name ^^.

#MAX LEVEL# - This is the level at which you will start to catch the fish 100% of the time

PLEASE NOTE: That, you can make it so that you can have more than one fishing spot, by simply copying and pasting this code into a free case slot further down, and changing the numbers around.
PM me if you get stuck XD



For the more advanced programmers

A more advanced programmer would notice that I have made two new Sub-Routines; called 'GoFishing' and 'ReplaceOneInvItem'. Any of you are welcome to use this subroutine, and I shall give you the Syntax for it:



GoFishing(INDEX, ITEM, MAXLEVEL, "NAME")

-Sets the variables for going fishing. Item, is the item number. Maxlevel, is the level at which you start catching the fish 100% of the time. Name, is the name of the fish - The name that's printed into the Player Message.

Example:Call GoFishing(index, 24, 5, "Shrimp")



ReplaceOneInvItem(INDEX, OLDITEM, NEWITEM)

-This replaces just ONE of the items in your inventory with another item. Set the replace item to 0, to replace the item with an empty slot, or to fill the next empty slot.

Example:Call ReplaceOneInvItem(index, 24, 0)



However, some of you may be wondering why it is replace 'ONE' inv item. This is because i have made another which i shall also give you the syntax for ^^.



ReplaceAllInvItems(INDEX, OLDITEM, NEWITEM)

Will search every single slot in your inventory and replace an item with a new item. Set the replace item to 0, to replace the items with an empty slot, or to fill all the empty slots.

ExampleCall ReplaceAllInvItems(index, 24, 0)



And then, you will also need the code for this sub... (Although you DO NOT need this code to make the fishing script work)

Code:
 
Sub ReplaceAllInvItem(index, olditem, newitem)
Dim n
n = 1
Do
   If GetPlayerInvItemNum(index, n) = olditem Then
      Call SetPlayerInvItemNum(index, n, newitem)
      Call SendInventoryUpdate(index, n)
   End If
   n = n + 1
Loop Until n > 24
End Sub
ChilliDog
Active Member
***
Offline Offline

Posts: 111


View Profile Email
« Reply #1 on: September 03, 2005, 01:03:26 PM »

Ok, I'm confused. After I put this in my Main.txt what do I do? Like in-game, how do I make a fishing spot and when I do how do I go about  actually fishing?
Marsh
Demi God

Offline Offline

Posts: 7,280


Comfort the disturbed. Disturb the comfortable.


View Profile WWW Email
User is on moderator watch listWatched
« Reply #2 on: September 03, 2005, 03:27:53 PM »

If you dont no scripting than i cant really explain it. Cuss i dont no it either :D
JayR
Crumpet Slangin Fo life.
Administrator
Advanced Eclipser
*
Offline Offline

Posts: 1,266


I like my women like my crumpets lightly toasted.


View Profile Email
« Reply #3 on: September 09, 2005, 05:14:25 PM »

lol anyone need help with scripts ask me i think i know how to use them.
wizard of doom
Guest


Email
???
« Reply #4 on: October 02, 2005, 09:07:52 PM »

o....k.... I really need to know what the hell to do with this script.... please some one help me cus im confused as h***.
Marsh
Demi God

Offline Offline

Posts: 7,280


Comfort the disturbed. Disturb the comfortable.


View Profile WWW Email
User is on moderator watch listWatched
« Reply #5 on: October 03, 2005, 07:17:47 AM »

If you dont no how to use the scripts. Dont use them
wizard of doom
Guest


Email
« Reply #6 on: October 10, 2005, 05:15:45 PM »

I think you just stand on the tile and you will be activating the script. You will know when a sprite pops up in the inventory thing.  

(Just a Guess) :lol:

oh and i dont know if it lets there be an animation...
JayR
Crumpet Slangin Fo life.
Administrator
Advanced Eclipser
*
Offline Offline

Posts: 1,266


I like my women like my crumpets lightly toasted.


View Profile Email
« Reply #7 on: October 10, 2005, 06:19:03 PM »

i agree with marsh.If u don't know how,then learn how.look for some tutorials.
Steve
Active Member
***
Offline Offline

Posts: 171


View Profile WWW Email
« Reply #8 on: November 10, 2005, 05:53:04 PM »

I installed it and it works! Thanks whoever made it. My question os does anyone know if i can make it random for them to catch a fish? If so please let me know i want there to be a sertin chance there gonna get a fish. And that is right if you dont know how to script dont use them.Thanks for eclipse marsh cant wait for the bank version!
Your friend,
Steve
JayR
Crumpet Slangin Fo life.
Administrator
Advanced Eclipser
*
Offline Offline

Posts: 1,266


I like my women like my crumpets lightly toasted.


View Profile Email
« Reply #9 on: November 15, 2005, 10:17:44 PM »

this is possible but kinda hard
algrn912005
Member
**
Offline Offline

Posts: 47


View Profile Email
« Reply #10 on: November 19, 2005, 09:19:53 AM »

When I try to add more than one mining script in a free case slot such as this:
Code: [Select]

     Case 5
   Dim mineweapon
   mineweapon = GetPlayerWeaponSlot(index)
   If mineweapon = 0 Then
      Call PlayerMsg(index, "You don't have a pickaxe equipped", 15)
      ElseIf GetPlayerInvItemNum(index, mineweapon) = 9 Then
      Call GoMining(index, 10, 15, "Red ore")
      Else
      Call PlayerMsg(index, "You don't have a pickaxe equipped", 15)
   End If
   
    Case 6
   Dim mineweapon
   mineweapon = GetPlayerWeaponSlot(index)
   If mineweapon = 0 Then
      Call PlayerMsg(index, "You don't have a Blue Ore detector equipped", 15)
      ElseIf GetPlayerInvItemNum(index, mineweapon) = 12 Then
      Call GoMining(index, 11, 30, "Blue Ore")
      Else
      Call PlayerMsg(index, "You don't have a Blue Ore detector equipped", 15)
   End If


it doesnt work. such as all the scripts stop working. when I have only one script it works but If i have more it doesnt. Please help me. thanks
Steve
Active Member
***
Offline Offline

Posts: 171


View Profile WWW Email
« Reply #11 on: January 07, 2006, 03:22:11 PM »

Lol how longhas this been here? You need to change the varible man here is the correct code for 2.
Code: [Select]

     Case 5
   Dim mineweapon
   mineweapon = GetPlayerWeaponSlot(index)
   If mineweapon = 0 Then
      Call PlayerMsg(index, "You don't have a pickaxe equipped", 15)
      ElseIf GetPlayerInvItemNum(index, mineweapon) = 9 Then
      Call GoMining(index, 10, 15, "Red ore")
      Else
      Call PlayerMsg(index, "You don't have a pickaxe equipped", 15)
   End If
   
    Case 6
   Dim mineweaponf
   mineweaponf = GetPlayerWeaponSlot(index)
   If mineweaponf = 0 Then
      Call PlayerMsg(index, "You don't have a Blue Ore detector equipped", 15)
      ElseIf GetPlayerInvItemNum(index, mineweapon) = 12 Then
      Call GoMining(index, 11, 30, "Blue Ore")
      Else
      Call PlayerMsg(index, "You don't have a Blue Ore detector equipped", 15)
   End If

And here is 4!
Code: [Select]

     Case 5
   Dim mineweapon
   mineweapon = GetPlayerWeaponSlot(index)
   If mineweapon = 0 Then
      Call PlayerMsg(index, "You don't have a pickaxe equipped", 15)
      ElseIf GetPlayerInvItemNum(index, mineweapon) = 9 Then
      Call GoMining(index, 10, 15, "Red ore")
      Else
      Call PlayerMsg(index, "You don't have a pickaxe equipped", 15)
   End If
   
    Case 6
   Dim mineweaponf
   mineweaponf = GetPlayerWeaponSlot(index)
   If mineweaponf = 0 Then
      Call PlayerMsg(index, "You don't have a Blue Ore detector equipped", 15)
      ElseIf GetPlayerInvItemNum(index, mineweapon) = 12 Then
      Call GoMining(index, 11, 30, "Blue Ore")
      Else
      Call PlayerMsg(index, "You don't have a Blue Ore detector equipped", 15)
   End If

     Case 7
   Dim mineweapong
   mineweapong = GetPlayerWeaponSlot(index)
   If mineweapong = 0 Then
      Call PlayerMsg(index, "You don't have a pickaxe equipped", 15)
      ElseIf GetPlayerInvItemNum(index, mineweapon) = 9 Then
      Call GoMining(index, 10, 15, "Red ore")
      Else
      Call PlayerMsg(index, "You don't have a pickaxe equipped", 15)
   End If
   
    Case 8
   Dim mineweaponp
   mineweaponp = GetPlayerWeaponSlot(index)
   If mineweaponp = 0 Then
      Call PlayerMsg(index, "You don't have a Blue Ore detector equipped", 15)
      ElseIf GetPlayerInvItemNum(index, mineweapon) = 12 Then
      Call GoMining(index, 11, 30, "Blue Ore")
      Else
      Call PlayerMsg(index, "You don't have a Blue Ore detector equipped", 15)
   End If


If you cant see what i changed here i changed this
Code: [Select]

Dim mineweapon
mineweapon = GetPlayerWeaponSlot(index)
If mineweapon = 0 Then

To
Code: [Select]

Dim mineweaponf
mineweaponf = GetPlayerWeaponSlot(index)
If mineweaponf = 0 Then

Because if you have 2 of the same variables it wont work it will confuse your scripting.
Cro
Guest


Email
« Reply #12 on: January 12, 2006, 05:51:00 PM »

I installed it and it works, only thing is when I put a "Scripted" tile on the map it does the script when I just go over the tile. Any way I can make it so I have to press "enter" or another button for the script to activate?
oh and by the way, I’m really new at scripting and I had no problem putting this in... so for the people had trouble, maybe its time to find a new hobby. :)
Also… thanks for the script, maybe now my game won’t suck as much when the beta version comes out.
Cruzn
Member
**
Offline Offline

Posts: 27


View Profile Email
« Reply #13 on: January 12, 2006, 05:59:46 PM »

No. There is no option like that in sadscript.
Cro
Newb
*
Offline Offline

Posts: 22


View Profile Email
« Reply #14 on: January 12, 2006, 06:24:13 PM »

Ah, ok....
I guess that’s kind of a good thing to prevent people from farming wile afk (put something heavy down on the enter key and walk away) now you would have to hit up then down over and over near a lake/mining rock.

Off topic- First post!
Darkwolf
Active Member
***
Offline Offline

Posts: 104


View Profile Email
« Reply #15 on: January 15, 2006, 02:08:57 PM »

Mine doesn't seem to work. I think I've put the code in correct but how do I get it in the game? I presume I need to set a script from the attributes menu on the map editor but what is the number of the script I set and once its in and I have the right weapon equipped do I just attack the area I out it in?
Cro
Newb
*
Offline Offline

Posts: 22


View Profile Email
« Reply #16 on: January 16, 2006, 12:57:48 PM »

It tell you what number the script is, right at the top of the script. And to mine/fish you have to walk over the tile with the script (you also have to have your fishing rod/pickaxe equipped)
Darkmage
Newb
*
Offline Offline

Posts: 20


View Profile Email
« Reply #17 on: February 15, 2006, 11:08:32 AM »

I cant find the case part where is it?
Diaga
Active Member
***
Offline Offline

Posts: 340



View Profile Email
« Reply #18 on: February 15, 2006, 01:33:57 PM »

GAHH!!!!!
DO NOT ASK QUESTIONS LIKE THAT>

The scripted tile cases are there, LOOK FOR THEM. spend a moment actually reading, not glancing over, and you cant miss them. providing you are in your main.txt, then you should be able to find it.  We cant help you find something that is written down in plain english. Either you cant read, or are to lazy to try.  I mean seriously, its not hidden or anything.

p.s.  Female Dogy I know, but in foul mood, and its really not that hard..
yakuza_II
Active Member
***
Offline Offline

Posts: 310


View Profile Email
« Reply #19 on: February 15, 2006, 11:43:21 PM »

make sure uve made the items etc
Pages: [1] 2
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.444 seconds with 33 queries.