Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

An atempt at a fishing script


Recommended Posts

i used parts of many scripts from eclipse and some stuff i made i need to see if its right

```
Sub Take_Item(index, number, value)

Dim slot
Dim taken
Dim initial
Dim final

slot=1
taken=0
  Do While Int(slot) < 25     
      If Int(taken)=0 Then     
        If Getplayerinvitemnum(index,Int(slot)) = Int(number) Then
            If Int(getplayerinvitemvalue(index, Int(slot))) >= Int(value) Then
            initial = Int(getplayerinvitemvalue(index, Int(slot) ) )
            final = Int(initial) - Int(value)           
              If Int(final) <= 0 Then             
              Call setplayerinvitemnum(index, Int(slot), Int(0) )
              Call setplayerinvitemvalue(index, Int(slot), Int(0) )
              Call setplayerinvitemdur(index, Int(slot), Int(0) )
              Call SendInventoryUpdate(index, Int(slot))
              taken=1             
              Else           
              Call setplayerinvitemvalue(index, Int(slot), Int(final) )
              Call SendInventoryUpdate(index, Int(slot) )
              taken=1           
              End If
            End If       
        End If
      End If     
  slot = slot + 1
  Loop
End Sub   
```
```
Sub Skill_fishing(index)

Dim stamina
Dim chance
Dim total_chance
Dim has_needed
Dim need_count
Dim give_count
Dim slot
Dim count
Dim found
Dim number
Dim durability
Dim value
Dim experience
Dim name

If Int(GetVar("scripts/mapextras/" & GetPlayermap(index) & ".ini", "FISHING", "f_level")) <= Int(GetVar("scripts/charextras/" & GetPlayerName(index) & ".ini", "FISHING", "your_f_level")) Then
If Int(GetVar("scripts/mapextras/" & GetPlayermap(index) & ".ini", "FISHING", "f_weapon")) = GetPlayerWeapon Slot(index) Then
If Int(GetVar("scripts/mapextras/" & GetPlayermap(index) & ".ini", "FISHING", "f_stam")) <= Int(GetVar("scripts/charextras/" & GetPlayerName(index) & ".ini", "SKILL", "stamina")) Then
stamina = Int(GetVar("scripts/charextras/" & GetPlayerName(index) & ".ini", "SKILL", "stamina"))
chance = Int(GetVar("scripts/mapextras/" & GetPlayermap(index) & ".ini", "FISHING", "f_chance"))
total_chance = Rand(110 - Int(GetVar("scripts/charextras/" & GetPlayerName(index) & ".ini", "FISHING", "your_f_level")), 1)
If total_chance <= chance Then

                need_count=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", "need_count")
                count=1     
                slot=1
                has_needed=0

                'CHECK FOR ITEMS

                Do While count<=Int(need_count)
                number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", count & "_need_num")
                value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", count & "_need_val")
                slot=1

                  Do While slot < 25   
                      If Int(getplayerinvitemnum(index,slot))=Int(number) Then
                        If Int(getplayerinvitemvalue(index, slot))>=Int(value) Then
                        has_needed=has_needed+1
                        slot=25
                        End If 
                      End If
                  slot=slot+1
                  Loop

                count=count+1
                Loop

                If has_needed >= Int(need_count) Then
                has_needed=1
                count=1

                  Do While count<=Int(need_count)
                  number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", count & "_need_num")
                  value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", count & "_need_val")
                  slot=1         
                  Do While slot < 25   
                  If Int(getplayerinvitemnum(index,slot))=Int(number) Then
                  If Int(getplayerinvitemvalue(index, slot))>=Int(value) Then
                  Call quest_Take_Item(index, number, value)
                  slot=25
                  End If 
                  End If
                  slot=slot+1
                  Loop
                  count=count+1
                  Loop

                Else
                has_needed=0
                End If

      slot=1
      count=0

Do While slot < 25
                If Int(getplayerinvitemnum(index,slot))=0 Then
                count=count+1
                End If           
            slot=slot+1
            Loop 

            give_count=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", "give_count")

            If Int(count)>=Int(give_count) Then

            count=1

            Do While Int(count)<=Int(give_count)
            number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", count & "_num")
            value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", count & "_val")
            durability=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", count & "_dur")           
            slot=1       
              Do While slot < 25
                    If Int(getplayerinvitemnum(index,slot))=0 Then
                      Call setplayerinvitemdur(index, Int(slot), Int(durability))
                      Call setplayerinvitemvalue(index, Int(slot), Int(value))
                      Call setplayerinvitemnum(index, Int(slot), Int(number))
                      Call sendinventoryupdate(index, slot)
                      slot=25
name=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", "name")
Call Battlemsg(index, "You got a" & name , 14, 0)
                    End If           
              slot=slot+1
              Loop
            count=count+1
            Loop

            experience=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", "f_exp")
            Call Battlemsg(index, experience & " experience gained!", 14, 0)
            experience=experience + Int(GetVar("scripts/charextras/" & GetPlayerName(index) & ".ini", "FISHING", "your_f_exp"))
            Call PutVar("scripts/charextras/" & GetPlayerName(index) & ".ini", "FISHING", "your_f_exp", experience)
            Call PutVar("scripts/charextras/" & GetPlayerName(index) & ".ini", "SKILL", "stamina", Stamina - 1)
Call sendplayerdata(index)

            'MESSAGE FOR NO SPACE

            Else
            Call Battlemsg(index, "You have no space for more items.", 14, 0)
            End If

Else
Call Battlemsg(index, "You" & getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "FISHING", "action") & "nothing", 14, 0)

Else
Call Battlemsg(index, "Your too tired to fish.", 12, 0)
Else
Call Battlemsg(index, "You need the right fishing tool.", 12, 0)
Else
Call Battlemsg(index, "Your Fishing level is to low.", 12, 0)

```
```
charextras
[FISHING]
your_f_level=
your_f_exp=
your_f_data=

[SKILL]
stamina=
stamina_max
```
```
mapextras
[FISHING]
name=
action=
f_level=
f_chance=
f_weapon=
f_stam=
need_count=1
1_need_num=
1_need_val=
give_count=1
1_num=
1_val=
1_dur=0
```
i just need this checked through my second script…so i know there are problems cause i can't get it to work
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...