truno
2012-03-22 01:14:05
How Long have You Played Runescape?
9 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Basically I am in college right now learning a programming language that goes with a program called MATLAB. I have always been interested in writing scripts and enjoy spending time to learn them. Back when reflection bots were still big I was able to make simple scripts but that is about it and I wish to learn more about this programming language and work on it.
Are you a member of any other communities?
I used to go into RsBuddy until they got sold out by Jacmob. Bought some scripts too, but this is the only site I go to now.
Tell us about yourself…
Please show us one (or multiple) of your scripts.
9 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Basically I am in college right now learning a programming language that goes with a program called MATLAB. I have always been interested in writing scripts and enjoy spending time to learn them. Back when reflection bots were still big I was able to make simple scripts but that is about it and I wish to learn more about this programming language and work on it.
Are you a member of any other communities?
I used to go into RsBuddy until they got sold out by Jacmob. Bought some scripts too, but this is the only site I go to now.
Tell us about yourself…
From: truno
I am a student at college that is working for my engineering degree, I like playing runescape, and I love tampering with computers and trying to make them run good. I basically enjoy being on the computer a lot. I also enjoy playing volleyball, and football.
Please show us one (or multiple) of your scripts.
I am not sure if this counts but I can show multiple scripts I have made for my MATLAB, and will hopefully make some good scripts for simba eventually also. These were basically my homework programming projects. (Starting from the beginning of the semester which was easier.)
1)
%% Programming Project 1 %%
%% Ch.2 PP4 %%
%% Setup %%
format long %like directions asked
%% Variables %%
x=2; %just a variable that =2
y=1; %just a variable that =5
%% Verifying with X %%
disp('(A.) Verify the relationships of sin,cos,tan with sinx/cosx=tanx when x=2')
disp('1. sin(x) *answer below*')
sin(x)
disp('2. cos(x) *answer below*')
cos(x)
disp('3. tan(x) *answer below*')
tan(x)
disp('4. (sin(x))/(cos(x)) *answer below*')
sin(x)/cos(x)
if (sin(x))/(cos(x))==tan(x);
disp('Great Job: sinx/cosx=tanx')
else
disp('WRONG: sinx/cosx should equal tanx')
end
disp(' ')
disp(' ')
%% Verifying with Y %%
disp('(B.) Verify the relationships of sin,cos,tan with siny+cosy*(cosy/siny)=1/siny when y=5')
disp('1. sin(y) *answer below*')
sin(y)
disp('2. cos(y) *answer below*')
cos(y)
disp('3. tan(y) *answer below*')
tan(y)
disp('4. 1/sin(y) *answer below*')
1/sin(y)
disp('5. plug sin,cos,tan into siny+cosy*(cosy/siny) *answer below*')
sin(y)+cos(y)*(cos(y)/sin(y))
if sin(y)+(cos(y)*(cos(y)/sin(y)))==(1/sin(y));
disp('Great Job: sin(y)+cos(y)*(cos(y)/sin(y))=1/sin(y)')
else
disp('WRONG: sin(y)+cos(y)*(cos(y)/sin(y)) should equal 1/sin(y)')
end
2)
%% PP2 %%
% page 80 #2 %
clc
clear
format long
%% A %%
vec=[45 8 2 6 98 55 45 -48 75] %the vector given
isOdd=(mod(vec,2)==1); %make each of the vectors divide by 2 and puts a 1 for each one true
problem_A=vec(isOdd) %now multiply the vector given by 1 or 0 from previous problem that determined t/f
%% B %%
vLength=length(vec) %finding the length of vec
vLength_Modified=length(vec(isOdd)) %finding the length of the vector that is made out of just odds
%% C %%
vSum=sum(vec) %finding the sum of vec
vSum_Modified=sum(vec(isOdd)) %finding the dum of the vector that is made out of just odds
%% D %%
D_part_1=mean(vec) %finding the average of vec
D_part_1_Modified=mean(vec(isOdd)) %finding the average of the vector that is made out of just odds
D_part_2=vSum/vLength %another way of finding the average of vec
D_part_2_Modified=vSum_Modified/vLength_Modified %another way of finding the average of the vector that is made out of just odds
%% E %%
vProd=prod(vec) %finding the product of vec
vProd_Modified=prod(vec(isOdd)) %finding the product of the vector that is made out of just odds
3)
%% Chapter 4 problem 4 %%
clc %clearing
clear %clearing
format long %just making the answer longer format if needed
Again = 'y'; %the initializer
while (Again == 'y') || (Again == 'Y') %When this script will run
clc %clearing again for the inside of the function
clear %clearing again for the inside of the function
format long %just making the answer longer format if needed for the inside
DecimalNumber = 0; %start for the answer so it will add them all to this decimal number
Location = 1; % the location at which number it is currently looking at
BinaryNumber = input('Please enter your binary number: ' , 's'); %finding out the binary number to convert
if (str2num(BinaryNumber) < 0)
disp('Sorry do not put in negative numbers.'); %making it so negatives do not work
else
while Location - 1 < length(BinaryNumber) %pretty much means while the location is less than the length of the binary number - 1 keep looping
DecimalNumber = ((2 ^ (length(BinaryNumber) - (Location))) * (str2num(BinaryNumber(Location))) + DecimalNumber); %formula for the binary number = it pretty much means 2 ^ position * the number that is in a certain string location to make it either 0 or 1 so that it will get rid of the 0s in the binary number and only add the 1s, and then + the previous answer.
Location = Location + 1; %so it will increase in location every time through the loop
end
Answer1 = fprintf('The binary number "%d" in ' , str2num(BinaryNumber)); %just showing number
Answer2 = fprintf('decimal format is: %d\n' , DecimalNumber); %just showing number
end
Again = input('Would you like to convert another binary number?(y/n): ' , 's'); %repeating
end
disp('Thank you for using my script'); %ending
4)
function rotatedText = rot(text , n)
for i = 1:length(text)
ascii = double(text(i));
if isUppercase(ascii)
ascii = double(text(i));
ascii = ascii - 65;
rotatedText(i) = char(mod(n + ascii , 26) + 65);
elseif isLowercase(ascii)
ascii = double(text(i));
ascii = ascii-97;
rotatedText(i) = char(mod(n + ascii, 26) + 97);
else
rotatedText(i) = text(i);
end
end
function upper = isUppercase(ascii)
upper = (ascii >= 65) && (ascii <= 90);
function lower = isLowercase(ascii)
lower = (ascii >= 97) && (ascii <= 122);
5)
% complex number = x+ yi (real part=x,imaginary part=y) have 3 functions.
% one that will give you the complex number, one that will add complex
% number, and one that will multiply complex number.
function cmplxA = makeComplexA(real , imag) %basically makes a complex number with user input
cmplxA = real + imag;
function cmplxB = makeComplexB(real , imag)
cmplxB = real + imag; %basically makes the second complex number
function res = cmplxAdd(cmplxA , cmplxB)
res = (real(cmplxA) + real(cmplxB)) + (imag(cmplxA) + imag(cmplxB))*i; %uses parts of the complex number, real and imaginary, to add the seperate parts together
function res = cmplxMult(cmplxA , cmplxB)
res = ((real(cmplxA) * real(cmplxB)) - (imag(cmplxA) * imag(cmplxB))) + ((real(cmplxA) * imag(cmplxB)) + (imag(cmplxA) * real(cmplxB))) * i;
%I basically foiled with the numbers of the complex number and got a
%formula to work with these numbers